📅  最后修改于: 2022-03-11 15:02:44.148000             🧑  作者: Mango
const num = 1234567;
const strNum = String(num);
const result = [];
for (let i = 0; i < strNum.length - 2; ++i) {
result.push(strNum.slice(i, i + 3));
}
console.log(result);
Run code snippet