Arrays & Iterables
Implement Array flatMap
easyJS SpecificJS / TS3 tests
Problem Statement
Implement `myFlatMap(array, callback)` that maps each element using a mapping function, then flattens the result into a new array by one level.
Examples
Example 1: myFlatMap([1, 2, 3], (x) => [x, x * 2]); // [1, 2, 2, 4, 3, 6]
JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.