JavaScript Questions

0 votes, 0 avg
611

JavaScript Questions

1 / 15

1. What will be the result or type of error if p is not defined in the following JavaScript code snippet?

console.log(p)

2 / 15

2. 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);

3 / 15

3. Among the given statements, which statement defines closures in JavaScript?

4 / 15

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

5 / 15

5. How to stop an interval timer in Javascript?

6 / 15

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

const prototype1 = {};  
const object1 = Object.create(prototype1);  
console.log(Object.getPrototypeOf(object1) === prototype1);

7 / 15

7.  Which of the following can be implemented using animation?

8 / 15

8. Which of the following is correct about JavaScript?

9 / 15

9. What is the central concept of JavaScript memory management?

10 / 15

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

function solve(arr, rotations){
 if(rotations == 0) return arr;
 for(let i = 0; i < rotations; i++){
   let element = arr.pop();
   arr.unshift(element);
 }
 return arr;
}
// solve([44, 1, 22, 111], 5);

11 / 15

11.  Where is Client-side JavaScript code is embedded within HTML documents?

12 / 15

12. Which statement creates a new object using the Person constructor?

13 / 15

13. Which JavaScript statements when embedded in an HTML page can respond to user events such as mouse clicks, form input and page navigation

14 / 15

14. Why JavaScript Engine is needed?

15 / 15

15. Which JavaScript method is used to write HTML output?

Your score is

0%

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