JavaScript Questions

0 votes, 0 avg
279

JavaScript Questions

1 / 15

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

2 / 15

2. The process in which an object or data structure is translated into a format suitable for transferral over a network, or storage is called?

3 / 15

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

// Javascript code to compare the height
function height()
{ 
    var  height = 123.56;
    var type = (height>=190) ? "tall" : "short";
    return type;
}

4 / 15

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

5 / 15

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

6 / 15

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

7 / 15

7. in javascript “===” operator defines what?

8 / 15

8.

Which one of the following is correct output for the following given JavaScript code if there is a p tag with id=demo ?
functionourFunction()
{
document.getElementById(“demo”).innerHTML=Math.abs(-7.25);
}

9 / 15

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

var a = "hello";
var sum = 0;
for(var i = 0; i < a.length; i++) {
   sum += (a[i] - 'a');
}
print(sum);

10 / 15

10. How to stop an interval timer in Javascript?

11 / 15

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

12 / 15

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

13 / 15

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

14 / 15

14. Which of the following is correct about JavaScript?

15 / 15

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

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