JavaScript Snippet
Generate Arrays from Args, Random, and Higher-Order Inputs
Difficulty: Medium
Three array-generation idioms that come up constantly: building a fixed-length array of computed values (random fillers, ranges, defaults), turning function arguments into an array, and writing higher-order functions that return array transformers parameterized by a constant. Each is one line of code, but the patterns generalize to test fixtures, configuration, and small DSLs.
