0 votes
in JavaScript by
What does this return?
[...'Lydia'];
  • A: ["L", "y", "d", "i", "a"]
  • B: ["Lydia"]
  • C: [[], "Lydia"]
  • D: [["L", "y", "d", "i", "a"]]

1 Answer

0 votes
by
Answer: A

A string is an iterable. The spread operator maps every character of an iterable to one element.

Related questions

0 votes
asked Mar 11 in JavaScript by DavidAnderson
0 votes
asked Mar 11 in JavaScript by DavidAnderson
...