遇到的面試題Givenanarraythatmaycontainnestedarrays,returnaflattenedarray.Inputandoutputareillustratedasfollows.將含有嵌套的數(shù)組排序輸出。*號部分為需要寫出的代碼。varinput=[{a:'a'},'b',['c','d'],['e',['f']],'g'];functionflatten_array(arr){varout=[];*******;returnout;}
Javascript數(shù)組排序
ibeautiful
2019-04-07 09:38:19