JavaScript Questions

0 votes, 0 avg
542

JavaScript Questions

1 / 15

1. In JavaScript, what is a block of statement?

2 / 15

2. The “function” and ” var” are known as:

3 / 15

3. 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;
}

4 / 15

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

const curr = new Date();
 document.write(curr);

5 / 15

5.  If A is the superclass and B is the subclass, then subclass inheriting the superclass can be represented as _________

6 / 15

6. Which of the following methods is used to access HTML elements using Javascript?

7 / 15

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

8 / 15

8.  Which is the function that calls another function after a time interval?

9 / 15

9. What will be the output of the following JavaScript code with a p tag with id=demo?

function myFunction() 
{
    document.getElementById("demo").innerHTML = Math.atan2(8, 4);
}

10 / 15

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

11 / 15

11. Which is the correct syntax to call an external JavaScript file in the current HTML document?

12 / 15

12. Which is the correct syntax for the function definition?

13 / 15

13. Which of the following global variables is used to get parameters?

14 / 15

14. how can you write into HTML output using javascript?

15 / 15

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

const arr = [10, 20, 30];
 let result = 0;
 
 arr.forEach(myFunction);
 
 document.write("Result: " , result)
 function myFunction(value, index, array) {
   result += value; 
 }

Your score is

0%