Skip to main content
InterviewHubPRO
Section Overview
Q329

Question 329 of 536

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

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

What is the output of below spread operator array

senior LevelCode ExampleAsync & PromisesEvent LoopData Structures
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.