Loading topic
typeof result2 min readnumber is a 64-bit IEEE 754 floating-point value. That format explains the rounding errors, the special values, and the integer limits covered here. Later chapters on conversion and equality dep2 min readtypeof works, and the Number edge cases from the previous chapter, especially the safe integer limit.2 min readNaN behave. Here you get the overall picture of conversion. Each later chapter covers one conversion rule in detail.2 min readtrue or false.2 min readNaN and Infinity. It explains the rules behind ToNumber, the internal operation JavaScript uses whenever it needs a number from some other value.2 min read*, +, and template literals work on primitives. When they receive an object, JavaScript first converts it to a primitive using2 min read+ operator follows its own rule, and the other arithmetic operators share one simpler rule.2 min readNaN and -0. JavaScript has three equality checks that never convert types. They differ in only two places: how they treat NaN and how they treat -0.2 min read===), ToNumber, and ToPrimitive from earlier chapters. Loose equality looks unpredictable, but the specification defines it as a short, fixed algorithm called IsLooselyEqual. Once you know its steps, you can trace any == result by hand.2 min readnull from undefined. The logical operators use those rules, but they don't return booleans. Each one returns one of its operands.2 min readtypeof returns for each type, including typeof null. It also assumes you know that arrays are objects and that primitives can be wrapped in objects such as new String("a"). On top of that, it covers the checks that fill the gaps typeof leaves.2 min read|| and ?? choose a value. It brings those rules together into a few habits that keep JavaScript from converting values in ways you did not plan.2 min read