Skip to main content
InterviewHubPRO
Section Overview
Q364

Question 364 of 536

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

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

What happens if we add two arrays

senior LevelCode ExampleAsync & PromisesEvent LoopData Structures

If you add two arrays together, it will convert them both to strings and concatenate them. For example, the result of adding arrays would be as below,

javascript
  console.log(["a"] + ["b"]); // "ab"
  console.log([] + []); // ""
  console.log(![] + []); // "false", because ![] returns false.