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
  1. What does `export { foo as default }` accomplish? Makes `foo` the default export of the module
  2. In JavaScript, what does `Object.freeze()` do? Makes all object properties read-only and prevents adding or removing properties
  3. 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
  4. What is the output of TypeScript compilation? JavaScript files
  5. 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
  6. What does `process.argv[2]` typically contain when you run `node app.js hello`? 'hello'
  7. What does `Object.defineProperty()` allow you to do? Define or modify a property with precise control over its descriptor attributes
  8. 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
  9. What does `instanceof` check? Whether an object's prototype chain includes the constructor's prototype
  10. What is the value of continuing education in closures and scope for JavaScript professionals? It keeps professionals current with evolving standards and practices
  11. What does the TypeScript `never` type represent? A type that has no values — used for functions that never return
  12. What is the value of continuing education in es6+ features for JavaScript professionals? It keeps professionals current with evolving standards and practices
  13. What types of errors can be thrown in JavaScript? Any value including strings, numbers, and objects
  14. What is the output of: `console.log(typeof Symbol('id'))`? 'symbol'
  15. 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
  16. What is a 'bare specifier' in ES module imports? An import path like `'lodash'` that doesn't start with `.`, `..`, or `/`
  17. What does `String.prototype.slice()` do with negative arguments? Negative values count from the end of the string
  18. What role does collaboration play in dom manipulation for JavaScript professionals? It enhances outcomes through diverse perspectives and shared expertise
  19. Which of the following objects has the URL property? Document
  20. Which method creates an object with a specified prototype object? Object.create()
  21. When `String.prototype.match()` is called with a regex that has the `g` flag, what does it return? An array containing all matched substrings
  22. What is the value of continuing education in modules for JavaScript professionals? It keeps professionals current with evolving standards and practices
  23. What is a tagged template literal? A function called with the template's string parts and interpolated values as arguments
  24. What is 'lexical scope' in JavaScript? Scope determined at author time based on where functions are written in the code
  25. Which syntax correctly re-exports a named export `helper` from `./utils.js`? export { helper } from './utils.js';
  26. What does `Array.prototype.copyWithin()` do? Copies a part of the array to another location within the same array
  27. What does `Set` guarantee about its stored values? Values are stored in insertion order and each value appears only once
  28. What does `Object.getPrototypeOf(obj)` return? The prototype of obj
  29. What is the value of continuing education in dom manipulation for JavaScript professionals? It keeps professionals current with evolving standards and practices
  30. What is the purpose of `Object.getPrototypeOf()`? Returns the prototype (internal `[[Prototype]]`) of the specified object
Was this helpful?