Skip to main content
JavaScript Interview Questions Predict Output P0 Medium

Detached method vs explicit call

Use strict-mode receiver rules. What does each invocation read?

Official Reference

Code Snippet

"use strict";
const profile = { name: "Ada", read() { return this?.name; } };
const read = profile.read;
const other = { name: "Lin", read };
console.log(profile.read(), read(), other.read());
console.log(read.call({ name: "Kai" }));

Expected Output & Explanation

Ada undefined Lin
Kai

The receiver is determined by the call site. The plain call gives undefined in strict mode, optional chaining returns undefined, and call supplies Kai’s object explicitly.

Module Context & References

JavaScript · Language output drills Trace closures, receivers, prototypes, coercion and array edge cases
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.