JavaScript Questions

0 votes, 0 avg
641

JavaScript Questions

1 / 15

1. Which of the following is the language of javascript?

2 / 15

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

3 / 15

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

4 / 15

4. What will be the output of the following JavaScript code If these is a p tag element with id="demo"?

var numbers1 = [4, 9];
var numbers2 = numbers1.map(myFunction);
document.getElementById("demo").innerHTML = numbers2;
function myFunction(value, index, array)
{
return value * 2;
}

5 / 15

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

6 / 15

6. Any time you include javascript variable in HTML document, you must enclose those lines inside a _______

7 / 15

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

 print(typeof(NaN)); 

8 / 15

8. Which of the following is correct about JavaScript?

9 / 15

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

10 / 15

10. What does the ‘toLocateString()’ method do in JS?

11 / 15

11. Which function is used to clear the timer value?

12 / 15

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

13 / 15

13. Arrays in JavaScript are defined by which of the following statements?

14 / 15

14. What is the purpose of the Attr object in the HTML DOM ?

15 / 15

15. Which of the following is the method used to add an element to the desired location?

Your score is

0%

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

Scroll to Top