Rapid fire 28 javascript questions and answers .

Check these rapid javascript questions and answers that will help you to understand Javascript in a different way. Question 1: What is typeof [] ? Ans: Object. Actually, Array is derived from Object. If you want to check the array use Array.isArray(arr) Question 2: What is typeof arguments? Ans: Object. arguments are array-like but not array. it has length, can access by index but can't push pop, etc. Question 3: What is 2+true? Ans: 3. The plus operator between a number and a boolean or two boolean will convert boolean to number. Hence, true converts to 1 and you get a result of 2+1 Question 4: What is '6'+9 ? Ans: 69. If one of the operands of the plus (+) operator is a string it will convert other numbers or boolean to string and perform concatenation. For the same reason, "2"+true will return "2true" Question 5: What is the value of 4+3+2+"1" ? Ans: 91 . The addition starts from the left, 4+3 results 7 and 7+2 is 9. So far, the plus o