Question d’entretien chez HackerEarth

Design a polyfill for Array. flat()