A block of statement can be understand as the set of the zero or more statements. In general, a block of statement has common definition "which combines one or a number of statements into a single statement for ease.
In JavaScript, when the interpreter encounters a empty statements it normally ignores or not response to that empty statement. The empty statements also sometimes very useful like we use the empty statements for creating loop for nothing.
The "function" and "var" both are the Declaration statements. These both are used for defining, and declaring variable, function in anywhere in the program.
In JavaScript, the local variable takes precedence over the global variable if the name of both local and global variables is the same.!
The JavaScript code can be called simply by making the function call to the element on which the JavaScript code execution has to be run. There are several other ways to call JavaScript code such as submit, onclick, and onload, etc.
The variables whose value can be modified that kind of variable are known as Mutable variable. In the JavaScript, only arrays and objects are mutable but not the primitive values.
In the case, where the result of any arithmetic expression is beyond the largest represent-able number,JavaScript prints the infinity. Similarly, if the result of any numerical operation is beyond the largest negative number, JavaScript prints negative infinity.
Yes, you heard right that division of any integer by zero is not an error in the JavaScript. It just prints the infinity as a result. However, there is an exception in JavaScript, dividing zero with zero will not have any defined number/value so, the result of this specific operation is a special value "Not a Number" or NaN and printed as NaN.
A function definition expression is a kind of "function literal' just like as the object initializer is a kind of "object literal". The function definition expression or we can say a function literalconsists of the keyword Function, followed by the set of identifiers or parameters names that are separated by commas inside the parenthesis, and a small block of JavaScript code which we normally called function body/definition enclosed in the curly braces.
In JavaScript, the primary expressions also called simplest expressions are those standalone expressions, which do not include any of the simpler expressions. The variable, constant or literal values and certain language keywords are the basic examples of the primary expressions.