JavaScript Questions: What is Coercion?




Unlike many languages, JavaScript is very forgiving when it comes to data types. Coercion refers to the conversion of one type to another that JavaScript performs in certain operations. It can be a blessing at times, but also can cause problems. In this video we address the world of coercion.

For a complete list of all our tutorials:
http://www.allthingsjavascript.com/youtube.html

Access to EVERY course (get 2 months free): https://www.skillshare.com/r/profile/Steven-Hancock/24508

Courses offered on Udemy at a discount:

Getting Started: https://www.udemy.com/learn-modern-javascript-getting-started/?couponCode=GETTINGSTARTED2019

Advanced Topics: https://www.udemy.com/learn-modern-javascript-advanced-topics/?couponCode=ADVANCED2019

Mastering Regular Expressions in JavaScript:
https://www.udemy.com/mastering-regular-expressions-in-javascript/?couponCode=YOUTUBE

Functional Programming in JavaScript: https://www.udemy.com/functional-programming-in-javascript-a-practical-guide/?couponCode=YOUTUBE19

NEW Mastering JavaScript Arrays: https://www.udemy.com/course/mastering-javascript-arrays/?couponCode=YOUTUBE19

Original source


8 responses to “JavaScript Questions: What is Coercion?”

  1. Being very Honest, I found your JavaScript classes to be the most useful of the dozens of courses I have purchased on Udemy. Your teaching style and the clarity of your examples is better than any of the others I have seen to date. I have learnt and understood more from one viewing of your course than any textbook I have read. The DOM and the Functions always have confused me until I purchased your courses and now I do understand them. Have you considered doing courses on Node JS, Angular ? I would be the first to purchase them.

  2. Very educative video. But I'm curious about something. In the following code, I intentionally neglected to wrap undefined in quotes, and it logged "undefined" (sans quotes) to the console instead of 10. Why is that?

    let i;

    if(typeof i === undefined) {
    i = 10;
    };

    console.log(i); // undefined

Leave a Reply