JavaScript Questions

0 votes, 0 avg
609

JavaScript Questions

1 / 15

1. What is the use of the noscript tag in Javascript?

2 / 15

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

3 / 15

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

4 / 15

4. Which of the following is correct about JavaScript?

5 / 15

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

6 / 15

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

const obj1 = {Name: "Hello", Age: 16};
const obj2 = {Name: "Hello", Age: 16};
print(obj1 === obj2);

7 / 15

7. Will the following JavaScript code work?

var js = (function(x) {return x*x;}(10));

8 / 15

8. Which property references the DOM object that dispatched an event?

9 / 15

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

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

10 / 15

10. What is the main difference between var and let keywords in JavaScript?

11 / 15

11. JavaScript code can be written in ____.

12 / 15

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

13 / 15

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

a = [1, 2, 3, 4, 5];
print(a.slice(2, 4));

14 / 15

14. Which object in Javascript doesn’t have a prototype?

15 / 15

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

Your score is

0%