Capgemini interview question

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