Interview Q&A / JavaScript

INTERVIEW Q&A · 71 QUESTIONS

JavaScript interview questions

Closures, the event loop, this, promises and the core language questions every frontend round asks.

  1. What do [] + [] and [] + {} evaluate to in JavaScript?

    [] + [] is the empty string and [] + {} is "[object Object]". The + operator turns both sides into strings when neither is a number, and an empty array stringifies to an empty string.

    IntermediateQuick answer1 min read