Capgemini Interview Question

Deep nested array , we have to flatten it without flat method in javascript.