javascript-exam 0 votes, 0 avg 255 123456789101112131415 JavaScript Questions 1 / 15 1. Which JavaScript method is used to write HTML output? A. document.write() B. document.output() C. console.log() D. document.writeHTML() 2 / 15 2. What will be the output of the following code snippet? print(typeof(NaN)); A. Object B. Number C. String 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 JavaScript method is used to write into an alert box? A. windows.alert() B. window.alert() C. document.alert() D. alert.window() 5 / 15 5. 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 6 / 15 6. 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() 7 / 15 7. What will be the output of the following JavaScript code? var cars = ["Honda","Hyundai","Mahindra"]; var result = cars.shift(); document.writeln("Result: ", cars); A. Result: Honda,Hyundai,Mahindra B. Result: Honda C. Result: Hyundai,Mahindra D. Result: Honda,Mahindra 8 / 15 8. What will be the output of the following JavaScript code? var quiz=[1,2,3]; var js=[6,7,8]; var result=quiz.concat(js); document.writeln(result); A. 1, 2, 3, 6, 7, 8 B. 123 C. 1, 2, 3 D. Error 9 / 15 9. Why JavaScript Engine is needed? A. Both Compiling & Interpreting the JavaScript B. Parsing the javascript C. Interpreting the JavaScript D. Compiling the JavaScript 10 / 15 10. 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 11 / 15 11. Which of the following is the language of javascript? A. text/javascript B. text/ECMAscript C. text/Vbscript D. javaScript VBscript 12 / 15 12. What will be the output of the following JavaScript code? const arr = [10, 20, 30]; let result = 0; arr.forEach(myFunction); document.write("Result: " , result) function myFunction(value, index, array) { result += value; } A. Result: 60 B. Result: 102030 C. Result: 10,20,30 D. ValueError 13 / 15 13. What is the central concept of JavaScript memory management? A. Reliability B. Reachability C. Efficiency D. Transparency 14 / 15 14. Which of the following function of the String object returns the character in the string starting at the specified position via the specified number of characters? A. slice() B. split() C. substr() D. search() 15 / 15 15. 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 Your score is LinkedIn Facebook Twitter VKontakte 0% Restart quiz