-
반응형
let becomeTwoArray = function(array){
let result = [];
for(let i = 1 ; i<array.length ; i = i+2){
result.push([array[i-1],array[i]]);
}
if(array.length % 2 ===1){
result.push([array[array.length-1]]);
}
return result;
}
'기타' 카테고리의 다른 글
mysql limit (0) 2021.01.24 https (0) 2021.01.20 Interaction With Server (0) 2020.12.23 promise (0) 2020.12.21 익숙하지않은메서드 (0) 2020.12.17