Console.log([..."hello"])?

  • A'hello'
  • BUndefined
  • C['h', 'e', 'l', 'l', 'o']
  • D'lo'
Show answerHide answer

Correct answer C

The spread operator. in JavaScript expands iterable objects like strings or arrays. "hello" is a string, which is iterable. [."hello"] spreads each character into a new array. Resulting array: ['h', 'e', 'l', 'l', 'o']. It is not a single string or 'lo', and definitely not undefined.