js 集合各种工具 自律使我快乐 2022-04-27 107 阅读1分钟 字符串填充 0 let num = 900; let nStr = num.toString().padStart(8,'0'); console.log(nStr); //00000900