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 `Object.defineProperty()` allow you to do? → Define or modify a property with precise control over its descriptor attributes
- What is the value of continuing education in closures and scope for JavaScript professionals? → It keeps professionals current with evolving standards and practices
- 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 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 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
- 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 'lexical scope' in JavaScript? → Scope determined at author time based on where functions are written in the code
- What does `Array.prototype.copyWithin()` do? → Copies a part of the array to another location within the same array
- 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
- What does the WebSocket attribute Socket.readyState with a value of 2 mean? → Handshake connection
- What does `str.split(/,\s*/)` do? → Splits the string on each comma, discarding any spaces that immediately follow it
- What is the primary benefit of version control in async programming for JavaScript? → It tracks changes and enables collaboration
- What function was used to remove all name event handlers? → removeAllListeners(name)
- An event emitter is which of the following? → process
- What does `^` mean when placed at the very start of a regex pattern (outside a character class)? → Asserts the match must start at the beginning of the string
- What is a positive lookahead assertion in a regular expression? → A zero-width assertion that matches a position only if a specified pattern follows it
- What does the character class `[^abc]` match? → Any single character that is NOT a, b, or c
- Which standard construct for data validation is available in the development environment? → All of the above
- What does `String.prototype.includes()` do? → Returns true if the string contains the given substring, otherwise false
- Which professional attribute is most valued in modules within the JavaScript field? → Accountability and commitment to standards
- What does the quantifier `{2,5}` mean in a regular expression? → Matches between 2 and 5 occurrences of the preceding token
- What is the value of continuing education in node.js basics for JavaScript professionals? → It keeps professionals current with evolving standards and practices
- What does `Object.keys()` return? → An array of an object's own enumerable property names
- What does `Promise.race()` return? → A promise that resolves or rejects with the value of the first settled promise
- What does the `y` (sticky) flag do in a JavaScript regular expression? → Forces the match to start exactly at the regex's lastIndex position
Turn these facts into recall: