to know about JavaScript numbers - JSConf EU 2013 https://en.wikipedia.org/wiki/Double-precision_floating-point_format https://en.wikipedia.org/wiki/IEEE_floating_point http://frontender.info/nan-is-not-a-not-a-number/
and JS compiled JIT (article) JVM languages (Java, Clojure and Scala) and C-based languages (C/C++, Python, Perl) give result 0.1 + 0.2 != 0.3. Other 11 languages like: Common Lisp, COBOL, Fortran, Pascal and PL/SQL all give a "true" result to 0.1 + 0.2 = 0.3. source So thats why JS have hoisting too, source
); } func(); // [object Window] or [object global] function strictFunc() { "use strict"; alert( this ); } strictFunc(); // undefined // in function part 3 var user = { name: "John Doe", hi: function() { alert(this.name); }, bye: function() { alert("Bye"); } }; user.hi(); // John Doe (usual usage) // but now another call ( related to obj.method(), but now we’ll get a Reference Type) (user.name == "John Doe" ? user.hi : user.bye)(); // undefined source
a reference type. That’s common for most languages. But what if we: new Array(3) == ",,"; //true Wow, true?! Yeah…because the string representation of new Array(3): new Array(3).toString(); //",,"
professor he may perform a suicide…” Lets create two objects and keep their references in two variables with different references: var o1 = {}, o2 = {}; o1 == o2 || o1 === o2 // false but... o1 >= o2 && o1 <= o2 // true o1 != o2 && o1 !== o2 // true
localStorage.setItem('peopleCanFly', false); if (localStorage.getItem('peopleCanFly') { console.log('yeah!'); // runs?! } From the specification localStorage only accepts string values! If you want to store an object or other type of value, you can serialize the data with JSON.stringify and load it again with JSON.parse. — @Overv Also i personally recommend you to read all js-by-examples by bmkmanoj
is most likely what you want from a date {}), ({lol:'wut'} // dunno how to name it.. source // typeof null is object, source if (typeof obj === 'object' && obj !== null){ console.info(obj.prop); }