Html miscellaneous


  1. typeof “null” in JavaScript is _______.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    typeof “null” in JavaScript is an object. Basically null indicates nothing like it is a thing that does not exist. It is like a bug in JavaScript that its typeof comes to be an object. For emptying an object we can set it to null.


  1. Arrays in JavaScript are written within ____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Arrays in JavaScript are written in square brackets. The elements of array are separated by commas. Index of array items starts from 0. E.g. var fruits= [“apple”, “orange”, “banana”, “pine-apple”]; objects in JavaScript are written inside curly brackets.



  1. Which of the following keyword stops the execution of JavaScript?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    By using debugger keyword execution of JavaScript stops, and is debugger function is defined it is called at the moment, break is the keyword used to terminate a loop or a switch, return is used for exit from a function, try…catch handle the errors.


  1. For testing we should use ________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    For testing we used document.write() in JavaScript. If we use document.write() after HTML document, it will delete all existing HTML. This method can only be used for testing purposes.



  1. For displaying data in JavaScript, we can’t use ____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    We can display data in many ways in JavaScript.They are innerHTML, console.log(), window.alert(), document.write. document.getElementById(id) is a method used for accessing HTML element by JavaScript. Here id defines the HTML element.