Sunday 20 November 2016

JavaScript Test

JavaScript

  1. JavaScript is ECMAScript

  2. False
    True
    May be
    All of the above

  3. What is null in JavaScript?

  4. Null means empty string value.
    Null means absence of a value.
    Null means unknown value.
    Null means zero value.

  5. Variable in JavaScript declared with which of the following keyword?

  6. int
    Var
    string
    All of the above

  7. Which of the followings are primitive data types in JavaScript?

  8. string
    Number
    Boolean
    All of the above

  9. Which of the following is NOT a JavaScript object?

  10. var obj = {};
    var obj = { name: "Steve"};
    var obj = { name = "Steve"};
    var obj = new Object();

  11. Which of the following is NOT a correct way of declaring an array in JavaScript?

  12. var arr = [1, "two", 3 , 4 ];
    var arr = new Array();
    var[] arr = new Number(){5];
    None of the above

  13. What will 1 == "1" return?

  14. True
    False
    0
    1

  15. How to handle error in JavaScript?

  16. By writing error proof code.
    By using eval().
    By using if-else block
    By using try, catch & finally block.

  17. What will be the output of the following JavaScript code? for(var x = 1; x < 5; x++) c

  18. 11111
    12345
    1234
    None

  19. Which of the following is a valid JavaScript function?

  20. var myFunc = function myFunc(){ };
    function myFunc(){ };
    function(){ };
    function myFunc = { };

No comments: