11)How to define a anonymous function?
Ans) An anonymous function can be defined in similar way as a normal function but it would not have any name.
12)Can you assign a anonymous function to a variable?
Ans)Yes! An anonymous function can be assigned to a variable.
13)Can you pass a anonymous function as an argument to another function?
Ans)Yes! An anonymous function can be passed as an argument to another function.
15) How can you get the type of arguments passed to a function?
16)How can you get the total number of arguments passed to a function?
17) How can you get the reference of a caller function inside a function?
21)What is callback?
22)What is closure?
Ans)Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope
23)Which built-in method returns the character at the specified index?
Ans)charAt() method returns the character at the specified index.
24)Which built-in method combines the text of two strings and returns a new string?
Ans)concat() method returns the character at the specified index.
25)Which built-in method calls a function for each element in the array?
Ans)forEach() method calls a function for each element in the array.
29) What is the difference between == and ===?
Ans)The == operator checks equality only whereas === checks equality and data type i.e. value must be of same type.
33)What does the isNaN() function?
Ans) The isNan() function returns true if the variable value is not a number.
35)In which location cookies are stored on the hard disk?
36)What is the difference between undefined value and null value?
Ans)102030 because after a string all the + will be treated as string concatenation operator (not binary +).
Ans)3030 because 10+20 will be 30. If there is numeric value before and after +, it is treated is binary + (arithmetic operator).
Ans) The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number and no array object.
46)What is the use of Void(0)?
Ans)Void(0) is used to prevent the page from refreshing and parameter “zero” is passed while calling.
Void(0) is used to call another method without refreshing the page
47)What is the difference between an alert box and a confirmation box?
Ans) An alert box displays only one button which is the OK button. But a Confirmation box displays two buttons namely OK and cancel.
50)What is break and continue statements?
Ans)Break statement exits from the current loop. Continue statement continues with next statement of the loop.