1. What keyword creates a changeable variable?
2. What is the boolean value of the string “0”?
Boolean("0")
3. What is the length of this array?
let arr = ["x", "y", "z"];
4. What does a function return if it has no return statement?
5. Can JavaScript be included in any valid HTML file?
6. What will this display?
let x = 4; let y = 6; let z = x + "" + y; alert(z);
7. Will this behave the same in all browsers?
"hello".substring(-1);
8. What does parseInt return here?
parseInt(52.9);
9. Can browser JavaScript directly read/write arbitrary local files?
10. What will this loop alert?
let total=0; for(let i=1;i<=8;i++){ if(i%3===0) continue; if(i>5) break; total+=i } alert(total);
12. Do all JavaScript engines behave identically for every feature?
13. What is the result of “super”+”man”?
14. What does s.replace(/l/g,”#”) do to “balloon”?
15. What does s.replace(“l”,”#”) do to “balloon”?
16. Which returns the integer part of a number?
Math.floor(3.9)
17. What will this alert?
let a=4, b=2; function calc(x){ b = a + x; return ++b; } alert(calc(3));
18. How to append 5 to array nums?
19. Which event fires when the mouse enters an element?
20. typeof Infinity returns?
21. Which keyword declares a constant?
22. What does Number(“123”) return?
23. What does console.log(“5” – 2) output?
24. What is the result of [] + [] ?
25. typeof [] returns?
26. Which method removes the last item of an array?
27. What value does let x; create?
28. What does “hello”.toUpperCase() return?
29. Which operator checks both value and type?
30. What does “cat”.includes(“a”) return?
31. What does typeof null return?
32. What does !true evaluate to?
33. Which literal creates an array?
34. What does push() return?
35. Which loop runs the body at least once?
36. Which event triggers on a click?
37. What is the result of NaN === NaN ?
38. Which is a primitive type?
39. typeof function(){} returns?
40. What does JSON.stringify({a:1}) do?
41. Which method adds elements to the start of an array?
42. What does “10” + 1 produce?
43. How to make a shallow copy of array a?
44. Which checks array membership?
45. typeof (function(){}) returns?
46. Which method converts a string to lowercase?
47. What does 0 == “0” evaluate to?
48. Which declares a block-scoped variable?
49. Which method splits a string into an array?
50. Which array method returns true if every element passes the test?