javascript-exam 0 votes, 0 avg 608 123456789101112131415 JavaScript Questions 1 / 15 1. Which is the function used to call a function in every time duration? A. callafter() B. setInterval() C. setTimeout() D. setTime() 2 / 15 2. 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 3 / 15 3. Why JavaScript Engine is needed? A. Compiling the JavaScript B. Both Compiling & Interpreting the JavaScript C. Parsing the javascript D. Interpreting the JavaScript 4 / 15 4. 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 5 / 15 5. Which function is used to serialize an object into a JSON string in Javascript? A. Stringify() B. parse() C. convert() D. None of the above 6 / 15 6. 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> 7 / 15 7. What will happen, if the following JavaScript code is executed? var count =0; while (count <10) { console.log(count); count++; } A. An error is displayed B. An exception is thrown C. The values of count variable are logged or stored in a particular location or storage D. The value of count from 0 to 9 is displayed in the console 8 / 15 8. Which of the following methods can be used to display data in some form using Javascript? A. document.write() B. console.log() C. window.alert() D. all of the above 9 / 15 9. Which of the following can be implemented using animation? A. Fireworks B. Fade Effect C. Roll-in or Roll-out D. All of the mentioned 10 / 15 10. 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 11 / 15 11. 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 12 / 15 12. 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(); 13 / 15 13. What will be the result or type of error if p is not defined in the following JavaScript code snippet? console.log(p) A. Value not found Error B. Reference Error C. Null D. Zero 14 / 15 14. When an operator’s value is NULL, the typeof returned by the unary operator is: A. Boolean B. Object C. Undefined D. Integer 15 / 15 15. Which JavaScript statements when embedded in an HTML page can respond to user events such as mouse clicks, form input and page navigation A. Native B. Server-Side C. Local D. Client-Side Your score is LinkedIn Facebook VKontakte 0% Restart quiz By Wordpress Quiz plugin