A higher-order function accepts a function or returns one. The array methods map, filter, reduce, and flatMap use callbacks to describe four different jobs. map preserves the number and order of entries while changing each value. filter retains matching entries. reduce carries an accumulator, and its initial value decides what happens for an empty array. flatMap expands each input into zero or more output entries, then joins one level of arrays. Choose the method from the requested result shape. A tag cell can yield several tags, while a label-length task still needs one number for every row. Keep the callback rule separate from the surrounding iteration.