Content & privacy
Languages · INTERVIEW GUIDE

JavaScript & TypeScript

Scope, closures, async behavior, object identity, and the type system.

Practice this topic
Filters
5 questions

What is a closure?

JavaScript & TypeScript·Functions & objects

A closure is a function together with access to the variables in the scope where it was created. That access remains available even after the outer function has finished running. Closures are useful for private state, callbacks and functions configured with some remembered value.

Foundation2 min read

How does this work? How are arrow functions different?

JavaScript & TypeScript·Functions & objects

this is the receiver used when a regular function runs, and its value usually depends on how the function is called. Arrow functions do not create their own this; they use the surrounding one. This matters when a method is passed as a callback and loses its original receiver.

Intermediate2 min read

How do prototypes and classes work?

JavaScript & TypeScript·Functions & objects

A prototype is an object from which another object can inherit properties and methods. When a property is missing on an object, JavaScript follows its prototype chain until it finds the property or reaches null. Classes provide structured syntax for constructing objects and sharing methods through that mechanism.

Intermediate2 min read

Is spread a deep copy?

JavaScript & TypeScript·Functions & objects

Spread syntax creates a new outer object or array by copying its enumerable contents. It is a shallow copy, so nested objects are still shared references. This matters when updating React state or copying request data that another part of the application may modify.

Intermediate2 min read

Debounce vs throttle: what is the difference?

JavaScript & TypeScript·Functions & objects

Debouncing and throttling control how frequently a function runs when events arrive repeatedly. Debouncing waits for a quiet period, while throttling limits execution frequency during continued activity. They reduce unnecessary work but introduce different delays and must match the user experience.

Intermediate2 min read

Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.