mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
4 lines
351 B
JavaScript
4 lines
351 B
JavaScript
const xs = [1, 2, 3, 4, 5]
|
|
const seen = []
|
|
xs.forEach((x, i) => seen.push(x * i))
|
|
return [xs.map((x) => x * 2), xs.filter((x) => x % 2), xs.reduce((a, b) => a + b), xs.reduce((a, b) => a + b, 10), xs.find((x) => x > 2), xs.findIndex((x) => x > 2), xs.find((x) => x > 9), xs.some((x) => x > 4), xs.every((x) => x > 0), xs.flatMap((x) => [x, x]), seen]
|