1.
What will be the output of the following JavaScript code? Code: console.log(2 + 2 + "2");
2.
What does the following JavaScript code snippet do? Code: let a = 10; let b = 20; let temp = a; a = b; b = temp; console.log(a, b);
3.
What will be the output of the following JavaScript code? Code: console.log(typeof null);
4.
What does the following JavaScript code snippet do? Code: let x = 5; let y = x++; console.log(x, y);
5.
What will be the output of the following JavaScript code? Code: console.log("Hello" + 1 + 2);
6.
What does the following JavaScript code snippet do? Code: let x = "Hello"; let y = x.length; console.log(y);
7.
What will be the output of the following JavaScript code? Code: console.log("20" - 10);
8.
What does the following JavaScript code snippet do? Code: let x = "Hello"; console.log(x.toUpperCase());
9.
What will be the output of the following JavaScript code? Code: let x = 8; if (x % 2 === 0) { console.log("Even"); } else { console.log("Odd"); }
10.
What does the following JavaScript code snippet do? Code: let numbers = [1, 2, 3, 4, 5]; let sum = numbers.reduce((total, num) => total + num, 0); console.log(sum);