import { flattenDeep } from 'lodash';
const flat = flattenDeep([1,2[3], [4, [5,6]]);
Not sure why employers care about developers being able to write utility functions from scratch, when that is not (typically) the job developers are hired for.Having said that, I lament the issues that the OP brought up: poor naming, unfamiliarity with their language's data structures, etc. Those are issues that will come up. Especially naming.