Question PRG-JS-0006
EasyWhat is the output of this program?
console.log(JSON.stringify([1, 2, 3].map(x => x * 2)));
- A.
[2,4,6]
- B.
[1,4,9]
- C.
Show answer and explanation
Answer: A
map applies the function to each element, doubling them; JSON.stringify prints the resulting array.