🌍 Public
Viewing a saved revision (read-only)
603d51ccd1cf4d3f8ec84d450965da2f
Javascript Arrays
This example demonstrates JavaScript array methods by logging transformations of a hardcoded dataset to the browser console. It uses `filter` to select even numbers, `sort` with a custom comparator and the imported `ascending` function from d3 to order values, and `map` to create objects containing each number and its double. A `reduce` operation converts an array of key-value objects into a single object keyed by the original keys. The example runs entirely in the console without producing any visual output on the page.
AI-generated description