JSE Certified Entry-Level JavaScript Programmer study materials
JSE Certified Entry-Level JavaScript Programmer study resources

JSE Certified Entry-Level JavaScript Programmer: Built-in Objects and Standard Library

JSE Certified Entry-Level JavaScript Programmer · Work through your exam, one topic at a time.

All guide sections

Built-in Objects and Standard Library

What this domain covers

The standard library you are expected to know off-hand: string and number utilities, Math, Date, JSON, and the Map/Set collections. Items test exact return types and off-by-one conventions.

Strings and numbers

Strings are immutable; every method returns a new value. slice accepts negative indices, split('') explodes into characters, replace swaps only the first match unless the pattern is a global regex, and template literals interpolate with ${}. Number.isInteger and Number.isNaN do not coerce, unlike the global isNaN, which converts its argument first. toFixed(n) returns a string, so the result of (1.005).toFixed(2) is a string and can surprise you with binary rounding.

Math, Date, JSON

Math.round, Math.floor, Math.ceil, Math.max/min (with no arguments, max is -Infinity). Math.random() returns a value in [0, 1) - never exactly 1. Date month indices are zero-based; new Date(2024, 0, 15) is 15 January. JSON.stringify omits properties whose value is undefined or a function, turns such values into null inside arrays, and throws on circular references.

Collections

Map accepts keys of any type and keeps insertion order; Set stores unique values using SameValueZero. Both use .size, not .length, and both are iterable with for...of.

Worked example

const d = new Date(2024, 0, 15);
console.log(d.getMonth(), d.getDate());
console.log(JSON.stringify({ a: undefined, b: () => 1, c: [undefined] }));

Reasoning: the month argument is an index, so getMonth() is 0, while getDate() is the day of the month, 15. Stringify drops a and b entirely but must preserve array positions, so c becomes [null]: {"c":[null]}.

Traps

  • isNaN('abc') is true but Number.isNaN('abc') is false.
  • Always pass a radix when calling parseInt on user input.
  • JSON.parse requires double quotes; single-quoted or trailing-comma input throws.
  • typeof new String('a') is 'object'.