- Single Line Comment: It is represented by // (double forward slash)
- Multi Line Comment: It is represented by slash with asterisk symbol as /* write comment here */
42. What is the difference between == and ===?
The == operator checks equality only whereas === checks equality and data type i.e. value must be of same type.
- By object literal
- By creating instance of Object
- By Object Constructor
Let’s see a simple code to create object using object literal.
46. What does the isNaN() function?
The isNaN() function returns true if the variable value is not a number.
3030 because 10+20 will be 30. If there is numeric value before and after +, it is treated is binary + (arithmetic operator).
102030 because after a string all the + will be treated as string concatenation operator (not binary +).