Coerced by the Universe, Then by Javascript


Coerced by the Universe, Then by Javascript

Coerced by the Universe, Then by Javascript

There are many times in life when we shy away from things that we always wanted to learn (like piano or another language) because we are afraid. Whether its fear of failure, or the amount of time it will take, we tend to find excuses not to proceed. Ironically, yesterday I came across a TED talk with author Josh Kaufman and his speech centered on a 20-hour practice method that he comprised for himself to learn the ukulele. He mentioned that for years prior it was something he had always wanted to learn, but there was just not enough time to accomplish it.

Now, 20 hours of practice comes out to be about 45 minutes a day for one month. In comparison to the “10,000 hour rule”, Kaufman’s approach definitely sparked my interest. I started thinking about my current situation as a coding student, and in the past week and a half, I have already doubled the 20-hour mark, but I know there is so much more left to learn!

Furthermore, when it comes to learning, there are many different ways our brains can process information so I personally find it helpful to make lists of information that convey core principles, and study them repetitively.

This week in my quest to become an A-list coder, I am tackling Javascript and wanted to share some fundamentals that might help you now and myself later..

  1. The equality operator consists of two equal signs: ==
  2. It is highly recommended to only use the strict equality operator. In cases where types need to be coerced, it should be done explicitly and not left to the language’s complicated coercion rules.
  3. The strict equality operator consists of three equal signs: ===. It works like the normal equality operator, except that strict equality operator does not perform type coercion between its operands.
  4. While both == and === are called equality operators, they behave differently when at least one of their operands is an Object.
  5. The table below shows the results of the type coercion, and it is the main reason why the use of == is widely regarded as bad practice. It introduces hard-to-track-down bugs due to its complicated conversion rules.


0 Comments Leave a reply

    Leave a comment

    Your comment(click button to send)

    This is a unique website which will require a more modern browser to work!

    Please upgrade today!