Wpis z mikrobloga

@Mechu2115:

function zipIt(first, second) {
if(typeof first !== "number" || typeof second !== "number") {
throw "Unexpected value type";
}

const firstArr = first.toString().split("");
const secondArr = second.toString().split("");

return firstArr.reduce((p,c) => p.concat(c).concat(secondArr.shift()), "").concat(secondArr.join(""));

}
  • Odpowiedz