Certified Associate JavaScript Programmer cheat sheet
Certified Associate JavaScript Programmer · Keep the key ideas within reach.
JavaScript Language Fundamentals and Vendor-Neutral Certification Scope
varis function-scoped and hoisted with an initial value ofundefined;letandconstare block-scoped and hoisted but stay in the temporal dead zone until their declaration executes, so access before that point throws aReferenceError.constprevents rebinding the identifier, not mutation of the value:const a = []; a.push(1)is legal, whilea = []throws aTypeError.Primitive types are
string,number,bigint,boolean,undefined,symbol, andnull; everything else is an object, andtypeof nullreturns"object"as a historical quirk.typeofreturns"undefined","boolean","number","bigint","string","symbol","function", or"object"; it never returns"null"or"array".==applies abstract equality coercion (e.g.0 == ""istrue,null == undefinedistrue), whereas===compares type and value with no coercion;NaN === NaNisfalse.Falsy values are exactly
false,0,-0,0n,"",null,undefined, andNaN; all objects and non-empty strings are truthy, including[]and{}.thisbinding rules in priority order:newbinding, explicitcall/apply/bind, method call on an object, then default binding (global object in sloppy mode,undefinedin strict mode).Arrow functions do not create their own
this,arguments, orsuper; they capturethislexically from the enclosing scope and cannot be used as constructors.Closures capture variable bindings, not values: a
forloop usingvarshares one binding, so callbacks created in the loop see the final value unlessletor an IIFE creates a fresh binding.
Certification Scope: Core Language, Objects, Asynchrony, and Exam-Style Discrimination
Prototype lookup follows the internal
[[Prototype]]chain and stops atObject.prototype;Object.create(null)produces an object with no prototype, sotoStringis undefined on it.Object.freezemakes properties non-writable and non-configurable (shallow);Object.sealmakes them non-configurable but still writable;Object.preventExtensionsonly 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.Promisestates are pending, fulfilled, and rejected, and settle once;.thenreturns a new promise, and a returned value or thrown error from a handler determines that promise's outcome.asyncfunctions always return a promise;awaitsuspends the function and resumes it as a microtask, so code afterawaitruns before asetTimeoutcallback queued earlier.Array.prototypeiteration callbacks receive(element, index, array);map,filter, andslicereturn new arrays and do not mutate, whilesort,splice,push, andreversemutate the original array.JSON.stringifyomits properties whose value isundefined, a function, or a symbol, convertsNaNandInfinitytonull, and throws aTypeErroron circular references.Module scope: ES modules are always strict mode, have top-level
thisequal toundefined, hoist imports, and expose bindings live; CommonJS usesrequire,module.exports, and a function wrapper providing__dirname.Errors:
try/catch/finally-finallyruns even after areturnintry;throwaccepts any value;instanceof Errordistinguishes error types, and promise rejections are handled by.catchortry/await.