JavaScript Questions

0 votes, 0 avg
614

JavaScript Questions

1 / 15

1. How does forEach() method differ from a for statement?

2 / 15

2. When the switch statement matches the expression with the given labels, how is the comparison done?

3 / 15

3. What will be the output of the following code snippet?

(function(){
 setTimeout(()=> console.log(1),2000);
 console.log(2);
 setTimeout(()=> console.log(3),0);
 console.log(4);
})();

4 / 15

4. What will be the output of the following JavaScript code?

let x = "10";
    let y = + x;
    
    document.write(typeof y);

5 / 15

5. What is the code for getting the current time?

6 / 15

6. What will be the output of the following code snippet?

var x=12;
var y=8;
var res=eval("x+y");
document.write(res);

7 / 15

7. What will be the output of the following JavaScript code?

var quiz=[1,2,3];
var js=[6,7,8];
var result=quiz.concat(js);
document.writeln(result);

8 / 15

8. How are windows, tabs, iframes, and frames treated according to client-side javascript?

9 / 15

9. Which of the following is a valid function to truncate number of full minutes between two time stamps?

10 / 15

10. Which JavaScript method is used to create a new array with array elements that passes a test?

11 / 15

11. Which is the function used to call a function in every time duration?

12 / 15

12. What will be the output of the following code snippet?


var a = "Scaler";
var result = a.substring(2, 4);
document.write(result);

13 / 15

13. Which handler is triggered when the content of the document in the window is stable and ready for manipulation?

14 / 15

14. Which JavaScript method is used to access an HTML element by id?

15 / 15

15. Which function is used to serialize an object into a JSON string in Javascript?

Your score is

0%

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top