Reference

XCODX · Reference

JavaScript Reference

Reference pages for JavaScript — syntax, parameters, return values and runnable examples.

All JavaScript reference pages

Array.prototype.filter()

filter() builds a new array containing only the elements that pass a test you provide. The original array is left unchanged.

Array.prototype.map()

map() builds a new array by running a function on every element of an existing one. It never changes the original — it returns a transformed copy of exactly the same length. This is the standard way to turn one array into another in JavaScript.

Array.prototype.reduce()

reduce() collapses an array into a single value — a sum, a lookup object, a grouped structure — by running a function that carries an accumulator across every element.

Array.prototype.sort()

sort() orders an array in place. By default it sorts elements as strings; pass a compare function to sort numbers or objects correctly.

Object.entries()

Object.entries() returns an array of an object's own [key, value] pairs — the cleanest way to iterate an object when your loop needs both the key and the value.

Object.keys()

Object.keys() returns an array of an object's own enumerable string keys — the standard way to count properties or iterate over an object by turning it into an array first.

String.prototype.replace()

replace() returns a new string with the first match of a pattern swapped for a replacement. Pass a global regular expression, or use replaceAll(), to change every match.

String.prototype.split()

split() breaks a string into an array of substrings around a separator. Split on a comma to parse a CSV field, on '' to get characters, or on a regex for flexible delimiters.

This is the JavaScript reference on XCODX. Each page documents one feature completely — the exact syntax, its parameters and return value, the gotchas that trip people up, and runnable examples you can edit right on the page.

The pages below are grouped so related topics stay together. Pick one to dive in, or run anything you find in the JavaScript online compiler.

Frequently asked questions

What does the JavaScript reference cover?
Core JavaScript language features — array methods, string methods, objects and more — one focused page each, with syntax, parameters, return values, pitfalls and live examples.
Do the JavaScript examples run in the browser?
Yes. Every example runs live on the page, and you can open any of them in the full online editor to experiment further.
Which JavaScript version do these pages target?
Modern, standard JavaScript that runs in every current browser and in Node.js. Where a feature is newer, the page says so and notes the compatible fallback.