javascript-exam 0 votes, 0 avg 611 123456789101112131415 JavaScript Questions 1 / 15 1. Which JavaScript method is used to create a new array with array elements that passes a test? A. forEach() B. map() C. forMap() D. filter() 2 / 15 2. Among the given statements, which statement defines closures in JavaScript? A. JavaScript is a function that is enclosed with references to its inner function scope B. JavaScript is a function that is enclosed with references to its lexical environment C. JavaScript is a function that is enclosed with the object to its inner function scope D. None of the mentioned 3 / 15 3. Where is Client-side JavaScript code is embedded within HTML documents? A. A URL that uses the special javascript:code B. A URL that uses the special javascript:protocol C. A URL that uses the special javascript:encoding D. A URL that uses the special javascript:stack 4 / 15 4. Will the following JavaScript code work? var js = (function(x) {return x*x;}(10)); A. Exception will be thrown B. Memory leak C. Error D. Yes 5 / 15 5. Which collection object allows unique value to be inserted only once? A. Object B. Set C. Array D. Map 6 / 15 6. What is the central concept of JavaScript memory management? A. Transparency B. Reliability C. Reachability D. Efficiency 7 / 15 7. What will be the output of the following code snippet? var a = "hello"; var sum = 0; for(var i = 0; i < a.length; i++) { sum += (a[i] - 'a'); } print(sum); A. 47 B. NaN C. zero D. None of the above 8 / 15 8. Where is Client-side JavaScript code is embedded within HTML documents? A. A URL that uses the special javascript:code B. A URL that uses the special javascript:protocol C. A URL that uses the special javascript:encoding D. A URL that uses the special javascript:stack 9 / 15 9. Which of the following is not a vaid javascript variable.? A. 2names B. _first_and _lastname C. FirstAndLast D. first2last 10 / 15 10. Which variable is an implicit parameter for every function in javascript? A. argumentsList B. Arguments C. args D. argsArray 11 / 15 11. Which property references the DOM object that dispatched an event? A. self B. object C. target D. source 12 / 15 12. The correct syntax to write "Hello World" in javascript. A. jscript.write("Hello World") B. response.write("Hello World") C. print("Hello World") D. print.jscript("Hello World") 13 / 15 13. Which function is used to clear the timer value? A. clearTimervalue() B. clearTimeout() C. clear() D. flush(timer) 14 / 15 14. how can you write into HTML output using javascript? A. using innerHTML B. Using console.log() C. Using document.write() D. using window.alert() 15 / 15 15. What will be the output of the following code snippet? (function(a){ return (function(){ console.log(a); a = 6; })() })(21); A. 6 B. NaN C. 21 D. runtime error Your score is LinkedIn Facebook VKontakte 0% Restart quiz By Wordpress Quiz plugin