11) What is “SetTimeOut” function in javascript?
“SetTimeOut” function is used to call the function given as a parameter after some time delay. Below is the javascript code for the same –
setTimeout(function(){ alert("Text to Show"); }, 5000);
12) What is “SetInterval” function in javascript?
“SetInterval” function is used to call the function (given as a parameter) repeatedly after some time delay. Below is the javascript code for the same –
setInterval (function(){ alert("Text to Show"); }, 5000);
13) What is “ClearInterval” function in javascript?
“ClearInterval” function is used to clear the time set from function – “SetInterval()”.
14) How to give comments in javascript?
- For single line comment – “//”
- For multi-line comments – “/* */”
15) Why to use “===” operator in javascript?
“===” operator is called strict operator and it returns true when both the values are same and returns false when the values are not same.