InterviewHubPRO
Section Overview
Q329

Question 329 of 521

Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

63%
JavaScript Internals (521 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

What is the output of below spread operator array

javascript
  [..."John Resig"];

The output of the array is ['J', 'o', 'h', 'n', ' ', 'R', 'e', 's', 'i', 'g']

Explanation: The string is an iterable type and the spread operator within an array maps every character of an iterable to one element. Hence, each character of a string becomes an element within an Array.