JavaScript Cheat Sheet 2026
The 30 highest-yield JavaScript facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
30 questions
45 min time limit
70.00% to pass
- What does `export { foo as default }` accomplish? → Makes `foo` the default export of the module
- In JavaScript, what does `Object.freeze()` do? → Makes all object properties read-only and prevents adding or removing properties
- What is the `unknown` type in TypeScript and how does it differ from `any`? → `unknown` requires type narrowing before use, while `any` bypasses type checks entirely
- What is the output of TypeScript compilation? → JavaScript files
- What happens when you call `EventEmitter.emit('error')` and no 'error' listener is registered? → Node.js throws an unhandled error and may crash the process
- What does `process.argv[2]` typically contain when you run `node app.js hello`? → 'hello'
- What does `Object.defineProperty()` allow you to do? → Define or modify a property with precise control over its descriptor attributes
- What is the key difference between ES6 `class` and traditional constructor functions? → Class bodies are always in strict mode; constructor functions are not by default
- What does `instanceof` check? → Whether an object's prototype chain includes the constructor's prototype
- What is the value of continuing education in closures and scope for JavaScript professionals? → It keeps professionals current with evolving standards and practices
- What does the TypeScript `never` type represent? → A type that has no values — used for functions that never return
- What is the value of continuing education in es6+ features for JavaScript professionals? → It keeps professionals current with evolving standards and practices
- What types of errors can be thrown in JavaScript? → Any value including strings, numbers, and objects
- What is the output of: `console.log(typeof Symbol('id'))`? → 'symbol'
- What happens when you use the spread operator `...` to copy an object? → A new object is created with a shallow copy of the original's own enumerable properties
- What is a 'bare specifier' in ES module imports? → An import path like `'lodash'` that doesn't start with `.`, `..`, or `/`
- What does `String.prototype.slice()` do with negative arguments? → Negative values count from the end of the string
- What role does collaboration play in dom manipulation for JavaScript professionals? → It enhances outcomes through diverse perspectives and shared expertise
- Which of the following objects has the URL property? → Document
- Which method creates an object with a specified prototype object? → Object.create()
- When `String.prototype.match()` is called with a regex that has the `g` flag, what does it return? → An array containing all matched substrings
- What is the value of continuing education in modules for JavaScript professionals? → It keeps professionals current with evolving standards and practices
- What is a tagged template literal? → A function called with the template's string parts and interpolated values as arguments
- What is 'lexical scope' in JavaScript? → Scope determined at author time based on where functions are written in the code
- Which syntax correctly re-exports a named export `helper` from `./utils.js`? → export { helper } from './utils.js';
- What does `Array.prototype.copyWithin()` do? → Copies a part of the array to another location within the same array
- What does `Set` guarantee about its stored values? → Values are stored in insertion order and each value appears only once
- What does `Object.getPrototypeOf(obj)` return? → The prototype of obj
- What is the value of continuing education in dom manipulation for JavaScript professionals? → It keeps professionals current with evolving standards and practices
- What is the purpose of `Object.getPrototypeOf()`? → Returns the prototype (internal `[[Prototype]]`) of the specified object
Turn these facts into recall:
Was this helpful?