this JavaScript Interview Questions
6 curated this interview questions for JavaScript — with short answers, detailed explanations, and interview tips. Ideal for Fresh through Tech Lead prep.
How is the value of `this` determined in JavaScript?
Fresh / InternConcept
What are the differences between `call`, `apply`, and `bind`?
JuniorComparison
When should you use an arrow function vs a regular method regarding `this`?
Mid-LevelBest Practice
What is logged in strict mode? ```js const obj = { x: 10, getX() { return this.x; }, }; const g = obj.getX; console.log(obj.getX()); console.log(g()); ```
Mid-LevelCode Output
Compare `this` binding for class prototype methods vs arrow class fields used as callbacks.
SeniorComparison
You wrap third-party methods with a Proxy or logging decorator. What `this`-related pitfalls should you design for?
SeniorArchitecture