JavaScript employs data types to characterize the kind of data that variables can handle. These include number, string, boolean, null, undefined.
The type of a JavaScript variable is dynamically determined by its value, allowing the type to change in accordance with its value.
JavaScript has special types: 'undefined' and 'null'. Each has only one value. 'undefined' means that a variable has been declared but does not yet have a value. 'null' implies the absence of a value. Note that we will use a special console.log method, which outputs the result in the console.
In JavaScript, 'undefined' is a type, while 'null' is an assignment value used to denote no value. You can think of 'undefined' as a bucket, into which we have forgotten to put anything, and 'null' as a bucket into which we've intentionally placed a note that says "nothing".
Statements are instructions that JavaScript executes. Statements can declare variables, assign values, perform computations, or make decisions based on certain conditions. JavaScript executes statements in the order they appear. Also, notice how we use ; symbol at the end of each statement? In JavaScript, a semicolon (;) is like a stop sign for your code – it tells the computer where one piece of code ends and another begins. While JavaScript often understands your code without semicolons, it's good practice to use them. This helps avoid confusion and errors in your programs.
In real-world scenarios, consider statements as analogous to a cooking recipe — each step is executed in the given order, ultimately creating a dish (or, in this case, a program).
