JavaScript Questions March 14, 2023 | No Comments 0 votes, 0 avg 434 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. 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> 3 / 15 3. Which variable is an implicit parameter for every function in javascript? A. args B. argsArray C. argumentsList D. Arguments 4 / 15 4. 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 5 / 15 5. 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 6 / 15 6. 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 7 / 15 7. 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 8 / 15 8. Which of the following is not considered as an error in javascript? A. syntax error B. missing of semicolon C. division by zero D. missing of bracket 9 / 15 9. 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(); 10 / 15 10. Which of the following is the method used to add an element to the desired location? A. add.element() B. element.add() C. element.appendChild() D. addelement() 11 / 15 11. Which collection object allows unique value to be inserted only once? A. Object B. Set C. Array D. Map 12 / 15 12. Why JavaScript Engine is needed? A. Both Compiling & Interpreting the JavaScript B. Parsing the javascript C. Interpreting the JavaScript D. Compiling the JavaScript 13 / 15 13. What is the purpose of the Attr object in the HTML DOM ? A. Used to focus on a particular part of the HTML page B. HTML Attribute C. Used to arrange elements D. CSS attribute 14 / 15 14. 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 15 / 15 15. Upon encountering empty statements, what does the Javascript Interpreter do? A. Throws an error B. Ignores the statements C. Gives a warning D. None of the above Your score is LinkedIn Facebook Twitter VKontakte 0% Restart quiz Questions, Quiz