JavaScript Reference
JavaScript Method Reference
Every method explained with syntax, parameters, examples, and common patterns.
Last updated: October 2026
What this is: A complete reference of JavaScript methods. Each page covers syntax, parameters, return values, live examples, common mistakes, and FAQs.
📚 All JavaScript Reference Pages
map()
Transform every element into a new array of the same length.
filter()
Keep only the elements that pass a test.
reduce()
Combine all elements into a single value — sum, object, array, or anything.
forEach()
Iterate with side effects. Returns undefined. Can't break early.
find()
Return the first matching element or undefined. Short-circuits fast.
findIndex()
Return the index of the first match, or -1. Perfect for updates and removals.
slice()
Copy a portion of an array without mutating the original. Supports negative indices.
splice()
Add, remove, or replace elements in place. Returns the removed elements.
includes()
Check if an array contains a value. NaN-safe. Returns true or false.
push()
Add one or more elements to the end of an array. Returns the new length.
pop()
Remove and return the last element. Mutates the array in place.
shift()
Remove and return the first element. Re-indexes the rest of the array.
unshift()
Add one or more elements to the start of an array. Returns the new length.
sort()
Sort array elements in place. Accepts a comparator for custom ordering.
concat()
Merge arrays into a new array without mutating. Flattens one level.
join()
Join array elements into a string with a custom separator.
reverse()
Flip the order of elements in place. Returns the same array reference.
flat()
Flatten nested arrays. Configurable depth or Infinity for full flatten.
flatMap()
Map then flatten one level. Faster than map().flat() chained.
Array.fromAsync()
Create an array from an async iterable. Sequential, lazy, ordered.
Iterator.concat()
Combine multiple iterables into one lazy iterator.
Uint8Array.toBase64()
Encode binary data to base64 or base64url. Replaces btoa().
Map.getOrInsert()
Get a value or insert a default. Kills has/set boilerplate.
Error.isError()
Reliable error detection across realms. Replaces broken instanceof.
Uint8Array.toHex()
Encode binary data as hex. Pairs with fromHex for roundtrips.