)

Javascript: Important Notes and Links

Last Updated: 1 year ago by BrodNeil

JavaScript is one of the most popular programming languages in the world and is used to create interactive websites, applications, and more. It has been around for more than two decades and continues to be developed by a large community of developers. With its wide range of uses, it’s important to stay up-to-date with JavaScript to get the most out of it. This article provides some important notes and links related to JavaScript that are essential for any experienced or aspiring developer.

Google recommends moving JavaScript below HTML headers

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.

Source: https://www.searchenginejournal.com/googles-john-mueller-move-javascript-below-html-headers/476024/

7 Shorthand Optimization Tricks for JavaScript Developers

These tricks can help you write better code for the following: 

  1. multiple string checks
  2. for-of and for-in loops
  3. falsy checks
  4. ternary operator 
  5. function calls
  6. switch shorthand
  7. fallback values

Source: https://dev.to/ruppysuppy/7-shorthand-optimization-tricks-every-javascript-developer-should-know-4fj5

Javascript Events and addEventListener

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

Reminder:

  • Keep your code DRY. Meaning Don’t Repeat Yourself. Learn how to abstract code.