Javascript Question and answers Learn Simpli September 6, 2019 no Comments 1. Can a function can be assigned to a variable in JavaScript? True False Some time None of the above None 2. How is strict mode in used to apply in JavaScript? "apply strict" "use strict" "strict" "strict mode" None 3. What will be the output of the below code? Init developer constructor Init developer constructor, Init employee constructor Init employee constructor Init employee constructor, Init developer constructor None 4. Find the output of the following JavaScript code?for(var x = 1; x < 5; x++)console.log(x); 5555 1234 12345 11111 None 5. What does eval() means in JavaScript? executes specified string as JavaScript code. It will return an object representing the parsed tree of the specified JavaScript code. It will execute server side code in JavaScript. It will display popup message. None 6. Is JavaScript a ECMAScript? True false both none None 7. What will be the output of the below code? test1@test.com, test2@test.com 0, 1, email, email None 8. Which is a valid JavaScript function in following answers? var myFunc = function myFunc{ }; function myFunc(){ }; myFunc function(){ }; function myFunc = { }; None 9. Which is NOT a correct way of declaring an array in JavaScript in following answers? ar arr = [1, "two", 3 , 4 ]; var arr = new Array(); var[] arr = new Number()[5]; None of the above None 10. What will be the output of the below code? 0, 1, 2, 10 1, 2, 10 0, 1, 2, 2 1, 2, 3, 10 None Hint 11. What will the following statement return 1 == "1" ? True False 1 0 None 12. Which is NOT a JavaScript object in the following? var obj = {}; var obj = { name: "Steve"}; var obj = { name = "Steve"}; var obj = new Object(); None 13. Which is an example of anonymous function in JavaScript in the following answers? var myFunc = function(){ }; function(){ }; var myFunc = (){ }; All of the above. None 14. What is the correct output of the following JavaScript code?var x = 0do{ console.log(x) }while(x > 0) 0 null 1 No output None 15. How a error can be handled in JavaScript? By using try, catch & finally block. By using if-else block By using eval(). By writing error proof code. None Time's up