-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Angular for Enterprise Applications - Third Edition
By :
JavaScript is a dynamically typed language. At runtime, the JavaScript engine executing our code, like Chrome’s V8, doesn’t know the type of variable we’re using. As a result, the engine must infer the type. We can have basic types like boolean, number, array, or string, or we can have a complex type, which is essentially a JSON object. In addition, variables can be null or undefined. In broad terms, undefined represents something that hasn’t been declared or initialized, and null represents the intentional absence of the value of a declared variable.
In strongly typed languages, the concept of undefined doesn’t exist. Basic types have default values, like a number being a zero or a string being an empty string. However, complex types can be null. A null reference means the variable is defined, but there’s no value behind it.
The inventor of the null reference, Tony Hoare, called it...