Question 6
Consider the 4 JavaScript code snippets given below.
Code Snippet 1:
let x = 10;const y;Code Snippet 2:
let { a: b } = undefined;Code Snippet 3:
const arr = [1, 2];arr = [3, 4];Code Snippet 4:
const a = 10, b = 20;(() => { return a + b; })();Which of the above JavaScript code snippet(s) will throw an error?
1 and 2
1, 2 and 3
2, 3 and 4
All 4