also returned when checking for object properties that do not exist. In a Boolean context, the undefined value is considered a false value. Note: undefined is considered a genuine primitive type. Unless explicitly converted, the undefined value may behave unexpectedly in comparison to other types that evaluate to false in a logical context. var test; // variable declared, but not defined, ... // ... set to value of undefined var testObj = {}; console.log(test); // test variable exists, but value not ... // ... defined, displays undefined console.log(testObj.myProp); // testObj exists, property does not, ... // ... displays undefined console.log(undefined == null); // unenforced type during check, displays true console.log(undefined === null); // enforce type during check, displays false Note: There is no built-in language literal for undefined. Thus is not a foolproof way to check whether a variable is undefined, because in versions before ECMAScript 5, it is legal for someone to write . A more robust approach is to compare using . Functions like this won't work as expected: function isUndefined(x) { var u; return x === u; } // like this... function isUndefined(x) { return x === void 0; } // ... or that second one function isUndefined(x) { return (typeof x) === "undefined"; } // ... or that third one Here, calling isUndefined(my_var) raises a if is an unknown identifier, whereas doesn't. Number Numbers are represented in binary as IEEE-754 floating point doubles. Although this format provides an accuracy of nearly 16 significant digits, it cannot always exactly represent real numbers, including fractions. This becomes an issue when comparing or formatting numbers. For example: console.log(0.2 + 0.1 === 0.3); // displays false console.log(0.94 - 0.01); // displays 0.9299999999999999 As a result, a routine such as the method should be used to round numbers whenever they are formatted for output. Numbers may be specified in any of these notations: 345; // an "integer", although there is only one numeric type in JavaScript 34.5; // a floating-point number 3.45e2; // another floating-point, equivalent to 345 0b1011; // a binary integer equal to 11 0o377; // an octal integer equal to 255 0xFF; // a hexadecimal integer equal to 255, digits represented by the ... // ... letters A-F may be upper or lowercase There's also a numeric separator, (the underscore), introduced in ES2021: // Note: Wikipedia syntax doesn't support numeric separators yet 1_000_000_000; // Used with big numbers