Master Code
On The Go

Learn. Practice. Build.

Home › Code Snippets › JavaScript › Reference

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.

Read Reference →
🔍

filter()

Keep only the elements that pass a test.

Read Reference →
🔁

reduce()

Combine all elements into a single value — sum, object, array, or anything.

Read Reference →
🔂

forEach()

Iterate with side effects. Returns undefined. Can't break early.

Read Reference →
🔍

find()

Return the first matching element or undefined. Short-circuits fast.

Read Reference →
🔢

findIndex()

Return the index of the first match, or -1. Perfect for updates and removals.

Read Reference →
📎

slice()

Copy a portion of an array without mutating the original. Supports negative indices.

Read Reference →
✂️

splice()

Add, remove, or replace elements in place. Returns the removed elements.

Read Reference →
✅

includes()

Check if an array contains a value. NaN-safe. Returns true or false.

Read Reference →
➕

push()

Add one or more elements to the end of an array. Returns the new length.

Read Reference →
➖

pop()

Remove and return the last element. Mutates the array in place.

Read Reference →
⬅️

shift()

Remove and return the first element. Re-indexes the rest of the array.

Read Reference →
➡️

unshift()

Add one or more elements to the start of an array. Returns the new length.

Read Reference →
🔤

sort()

Sort array elements in place. Accepts a comparator for custom ordering.

Read Reference →
🔗

concat()

Merge arrays into a new array without mutating. Flattens one level.

Read Reference →
🧵

join()

Join array elements into a string with a custom separator.

Read Reference →
🔄

reverse()

Flip the order of elements in place. Returns the same array reference.

Read Reference →
📐

flat()

Flatten nested arrays. Configurable depth or Infinity for full flatten.

Read Reference →
🗺️

flatMap()

Map then flatten one level. Faster than map().flat() chained.

Read Reference →
⚡

Array.fromAsync()

Create an array from an async iterable. Sequential, lazy, ordered.

Read Reference →
🔗

Iterator.concat()

Combine multiple iterables into one lazy iterator.

Read Reference →
🔐

Uint8Array.toBase64()

Encode binary data to base64 or base64url. Replaces btoa().

Read Reference →
🔑

Map.getOrInsert()

Get a value or insert a default. Kills has/set boilerplate.

Read Reference →
🚨

Error.isError()

Reliable error detection across realms. Replaces broken instanceof.

Read Reference →
🔢

Uint8Array.toHex()

Encode binary data as hex. Pairs with fromHex for roundtrips.

Read Reference →
← JavaScript Snippets Hub