Programming Languages10 lessons20 quiz questions
JavaScript & TypeScript
Master JavaScript and TypeScript for software engineering interviews, covering language internals, async patterns, type safety, and performance.
What You Will Learn
- ✓JS Fundamentals — var/let/const, Hoisting, Closures, Scope Chain
- ✓Prototypes & Classes — Prototype Chain, ES6 Classes, this Keyword
- ✓Async JavaScript — Callbacks, Promises, async/await, Event Loop
- ✓TypeScript Essentials — Types, Interfaces, Generics, Enums, Utility Types
- ✓DOM & Browser APIs — Event Handling, Fetch, Storage, Web Workers
- ✓ES6+ Features — Destructuring, Spread, Map/Set, Symbol, Proxy
- ✓Error Handling & Debugging — try/catch, Error Types, DevTools
- ✓Modules & Bundling — ESM, CommonJS, Webpack/Vite Basics
- ✓Testing — Jest, Testing Library, Mocking, TDD
- ✓Performance & Memory — Memory Leaks, Debounce/Throttle, Web Vitals
Overview
Master JavaScript and TypeScript for software engineering interviews, covering language internals, async patterns, type safety, and performance.
Session 1: JS Fundamentals
JavaScript's scoping model and hoisting behavior are the source of more interview questions — and production bugs — than almost any other language feature. Getting these right is foundational.
var, let, and const
is function-scoped and hoisted to the top of its containing function (or global scope) with an initial value of . This means you can reference a variable before its declaration line without a ReferenceError — you'll just get .
and are block-scoped (bounded by ). They are also hoisted, but they are NOT initialized. Accessing them before their declaration line throws a . The period between the start of the block and the declaration line is called the Temporal Dead Zone (TDZ).
additionally requires an initializer and cannot be reassigned. However, if the value is an object or array, the internal properties/elements can still be mutated.
Hoisting
Hoisting is JavaScript's behavior of moving declarations to the top of their scope before execution. Two things are hoisted: variable declarations (not initializations) and function declarations (fully — both name and body).
Scope Chain
Every function creates a new scope. When code references a variable, JavaScript looks it up in the current scope, then walks up the scope chain through enclosing scopes until it either finds the variable or reaches the global scope (where a ReferenceError is thrown if not found).
Scope is lexical — it is determined at write time by where functions are defined, not where they are called.
Closures
A closure is a function that retains a reference to its lexical environment even after the outer function has returned. The inner function closes over the variables of its enclosing scope.
Interview Insight
When asked about closures, always mention the practical applications: module pattern (data privacy), factory functions, event handlers, memoization, and partial application. Then demonstrate the loop gotcha — interviewers love that one.
Python Implementation
Sample Quiz Questions
1. What will the following code log? ```js console.log(typeof null); ```
Remember·Difficulty: 1/5
2. What is the output of: `console.log(0.1 + 0.2 === 0.3)`?
Understand·Difficulty: 2/5
3. Which of the following creates a SHALLOW copy of an object?
Understand·Difficulty: 2/5
+ 17 more questions available in the full app.
Related Topics
Master JavaScript & TypeScript for Your Next Interview
Get access to full lessons, adaptive quizzes, cheat sheets, code playground, and progress tracking — completely free.