Certified Associate JavaScript Programmer study materials
Certified Associate JavaScript Programmer study resources

Certified Associate JavaScript Programmer cheat sheet

Certified Associate JavaScript Programmer · Keep the key ideas within reach.

Quick reference

JavaScript Language Fundamentals and Vendor-Neutral Certification Scope

  • var is function-scoped and hoisted with an initial value of undefined; let and const are block-scoped and hoisted but stay in the temporal dead zone until their declaration executes, so access before that point throws a ReferenceError.

  • const prevents rebinding the identifier, not mutation of the value: const a = []; a.push(1) is legal, while a = [] throws a TypeError.

  • Primitive types are string, number, bigint, boolean, undefined, symbol, and null; everything else is an object, and typeof null returns "object" as a historical quirk.

  • typeof returns "undefined", "boolean", "number", "bigint", "string", "symbol", "function", or "object"; it never returns "null" or "array".

  • == applies abstract equality coercion (e.g. 0 == "" is true, null == undefined is true), whereas === compares type and value with no coercion; NaN === NaN is false.

  • Falsy values are exactly false, 0, -0, 0n, "", null, undefined, and NaN; all objects and non-empty strings are truthy, including [] and {}.

  • this binding rules in priority order: new binding, explicit call/apply/bind, method call on an object, then default binding (global object in sloppy mode, undefined in strict mode).

  • Arrow functions do not create their own this, arguments, or super; they capture this lexically from the enclosing scope and cannot be used as constructors.

  • Closures capture variable bindings, not values: a for loop using var shares one binding, so callbacks created in the loop see the final value unless let or an IIFE creates a fresh binding.

Quick reference

Certification Scope: Core Language, Objects, Asynchrony, and Exam-Style Discrimination

  • Prototype lookup follows the internal [[Prototype]] chain and stops at Object.prototype; Object.create(null) produces an object with no prototype, so toString is undefined on it.

  • Object.freeze makes properties non-writable and non-configurable (shallow); Object.seal makes them non-configurable but still writable; Object.preventExtensions only blocks new properties.

  • The event loop runs the call stack to empty, then drains all microtasks (promise callbacks, queueMicrotask), then takes one macrotask (setTimeout, I/O); microtasks queued during microtask drain also run before the next macrotask.

  • Promise states are pending, fulfilled, and rejected, and settle once; .then returns a new promise, and a returned value or thrown error from a handler determines that promise's outcome.

  • async functions always return a promise; await suspends the function and resumes it as a microtask, so code after await runs before a setTimeout callback queued earlier.

  • Array.prototype iteration callbacks receive (element, index, array); map, filter, and slice return new arrays and do not mutate, while sort, splice, push, and reverse mutate the original array.

  • JSON.stringify omits properties whose value is undefined, a function, or a symbol, converts NaN and Infinity to null, and throws a TypeError on circular references.

  • Module scope: ES modules are always strict mode, have top-level this equal to undefined, hoist imports, and expose bindings live; CommonJS uses require, module.exports, and a function wrapper providing __dirname.

  • Errors: try/catch/finally - finally runs even after a return in try; throw accepts any value; instanceof Error distinguishes error types, and promise rejections are handled by .catch or try/await.