JavaScript Questions March 14, 2023 | No Comments 0 votes, 0 avg 279 123456789101112131415 JavaScript Questions 1 / 15 1. Which property references the DOM object that dispatched an event? A. self B. object C. target D. source 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? A. Object Serialization B. Object Encapsulation C. Object Inheritance D. None of the above 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; } A. short B. 123.56 C. tall D. 190 4 / 15 4. Which handler is triggered when the content of the document in the window is stable and ready for manipulation? A. onload B. manipulate C. create D. onCreate 5 / 15 5. Where is Client-side JavaScript code is embedded within HTML documents? A. A URL that uses the special javascript:code B. A URL that uses the special javascript:protocol C. A URL that uses the special javascript:encoding D. A URL that uses the special javascript:stack 6 / 15 6. What is the use of the noscript tag in Javascript? A. The contents are displayed by non-JS-based browser B. clears all cookies ans cache C. both A and B D. None of the above 7 / 15 7. in javascript “===” operator defines what? A. Non-identical B. is equal to and is of the different types C. is equal to and is of the same type D. is equal 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); } A. 7 B. -7.25 C. -7 D. 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); A. 47 B. NaN C. zero D. None of the above 10 / 15 10. How to stop an interval timer in Javascript? A. clearInterval B. clearTimer C. interavlOver D. None of the above 11 / 15 11. Which is the function used to call a function in every time duration? A. callafter() B. setInterval() C. setTimeout() D. setTime() 12 / 15 12. Any time you include javascript variable in HTML document, you must enclose those lines inside a _______ A. <div> and </div> B. <body> and </body> C. <script> and </script> D. <html> and </html> 13 / 15 13. In JavaScript, what is a block of statement? A. Conditional block B. block that combines a number of statements into a single compound statement C. both conditional block and a single statement D. block that contains a single statement 14 / 15 14. Which of the following is correct about JavaScript? A. JavaScript is an Object-Based language B. JavaScript is Assembly-language C. JavaScript is an Object-Oriented language D. JavaScript is a High-level language 15 / 15 15. What will be the output of the following code snippet? a = [1, 2, 3, 4, 5]; print(a.slice(2, 4)); A. 3, 4 B. 2, 3 C. 3, 4, 5 D. 2, 3, 4 Your score is LinkedIn Facebook Twitter VKontakte 0% Restart quiz Questions, Quiz