字符串头部补全

42 阅读1分钟
let a = 1
a = a.toString().padStart(2, "0")
//a输出为“01”