Question d’entretien chez Prudential

PHONE INTERVIEW: Given a javascript array like [ 'a', 1, null, [ ], 2, [ 'b', 'c', [ 'd' , [[ ], [1,32, 'ksdjb']], [ ]] ] ]; write a function to flatten it so it looks like [ 'a', 1, null, 2, 'b', 'c','d'......];

Réponse à la question d'entretien

Utilisateur anonyme

10 févr. 2016

var combinedArray = []; function flatten(array) { for(var i=0; i