javascript-exam 0 votes, 0 avg 1 123456789101112131415 JavaScript Questions 1 / 15 1. What does the Javascript “debugger” statement do? A. It will debugg all the errors in the program at runtime. B. It acts as a breakpoint in a program C. it will debugg error in the current statement if any D. None of the above 2 / 15 2. Which is the correct syntax for the function definition? A. return_type function function_name(parameter1, parameter2, ...) { /*Function's body*/ } B. function function_name(parameter1, parameter2, ...) { /*Function's body*/ } C. return_type function_name(parameter1, parameter2, ...) { /*Function's body*/ } D. function function_name(parameter1, parameter2, ...) as return_type { /*Function's body*/ } 3 / 15 3. Which object in Javascript doesn’t have a prototype? A. Base Objects B. All Objects have prototype C. None of the objects have prototype D. None of the above 4 / 15 4. What will be the output of the following JavaScript code? let x = "10"; let y = + x; document.write(typeof y); A. string B. object C. undefined D. number 5 / 15 5. Which JavaScript method is used to write into an alert box? A. windows.alert() B. window.alert() C. document.alert() D. alert.window() 6 / 15 6. 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; } A. 8 9 B. 8 18 C. 4 9 D. error 7 / 15 7. Which is the correct syntax to call an external JavaScript file in the current HTML document? A. <script src="jsfile.js"></script> B. <script href=" jsfile.js"></script> C. <import src=" jsfile.js"></import> D. <script link=" jsfile.js"></script> 8 / 15 8. What will be the output of the following code snippet? var a = true + true + true * 3; print(a) A. 3 B. zero C. error D. 5 9 / 15 9. Why event handlers is needed in JS? A. Allows JavaScript code to alter the behaviour of windows. B. Adds innerHTML page to the code C. Change the server location D. Performs handling of exceptions and occurrences 10 / 15 10. What is the central concept of JavaScript memory management? A. Reliability B. Reachability C. Efficiency D. Transparency 11 / 15 11. How to stop an interval timer in Javascript? A. clearInterval B. clearTimer C. interavlOver D. None of the above 12 / 15 12. 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 13 / 15 13. Which of the following is not a vaid javascript variable.? A. 2names B. _first_and _lastname C. FirstAndLast D. first2last 14 / 15 14. Arrays in JavaScript are defined by which of the following statements? A. It is an ordered list of values B. It is an ordered list of objects C. It is an ordered list of string D. It is an ordered list of functions 15 / 15 15. JavaScript objects are written with _____. A. round brackets () B. curly brackets {} C. double quotes "" D. square brackets [] Your score is LinkedIn Facebook Twitter VKontakte 0% Restart quiz