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 is this inside a plain function call in strict mode versus sloppy mode?

    In sloppy mode a plain call gets the global object as this. In strict mode it gets undefined. Strict mode also stops call from boxing a primitive this into an object.

    IntermediateQuick answer1 min read