John Mueller of Google explains that this will ensure search engines can clearly understand what your website is about.
Why it matters? It has a positive SEO impact.
These tricks can help you write better code for the following:
- multiple string checks
- for-of and for-in loops
- falsy checks
- ternary operator
- function calls
- switch shorthand
- fallback values
Here is a full list of available events on the Mozilla Developer Network.
You can use
addEventListener to listen for events and interactions in an element.
Polyfills and How to Use Them
- Keep your code DRY. Meaning Don’t Repeat Yourself. Learn how to abstract code.