JSFiddle - React, Tailwind, and code Playground

by Jason Aden

JavaScript

console.clear();

// null is and isn't an object
console.log(typeof null); // 'object'
console.log(null instanceof Object); // false

break_here;

// NaN is a number?
alert(typeof NaN); //alerts 'Number'
alert(NaN === NaN); //evaluates false

// Empty array == false (coercion)
var myArray = [];
alert(myArray == false);
if (myArray) {
    alert('it is true');
} else {
    alert('it is false');
}

// More type coercion
alert(8 * null);
alert(“5” – 1);
alert(“5” + 1);