javascript-exam 0 votes, 0 avg 595 123456789101112131415 JavaScript Questions 1 / 15 1. Which statement creates a new object using the Person constructor? A. var student = construct Person; B. var student = new Person(); C. var student = Person(); D. var student = construct Person(); 2 / 15 2. Which of the following is the language of javascript? A. text/javascript B. text/ECMAscript C. text/Vbscript D. javaScript VBscript 3 / 15 3. What is the main difference between var and let keywords in JavaScript? A. var defines a variable while let defines a constant B. var defined function scoped variable while let define block scoped variable C. he value of a variable declared with var can be changed while the value of a variable declared with let cannot be changed D. all of the above 4 / 15 4. What will be the output of the following code snippet? var x=12; var y=8; var res=eval("x+y"); document.write(res); A. 20 B. x+y C. 128 D. None of the above 5 / 15 5. Which collection object allows unique value to be inserted only once? A. Object B. Set C. Array D. Map 6 / 15 6. 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 7 / 15 7. Which function is used to clear the timer value? A. clearTimervalue() B. clearTimeout() C. clear() D. flush(timer) 8 / 15 8. 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); A. 1 B. Undefined C. None of the above 9 / 15 9. What is the central concept of JavaScript memory management? A. Reliability B. Reachability C. Efficiency D. Transparency 10 / 15 10. When an operator’s value is NULL, the typeof returned by the unary operator is: A. Boolean B. Object C. Undefined D. Integer 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 property references the DOM object that dispatched an event? A. self B. object C. target D. source 13 / 15 13. Which of the following methods is used to access HTML elements using Javascript? A. getElementById() B. getElementByClassName() C. Both A and B D. None of the above 14 / 15 14. 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 15 / 15 15. 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> Your score is LinkedIn Facebook VKontakte 0% Restart quiz By Wordpress Quiz plugin