标签:string col pad tar ade span console pre ++
//允许将空字符串或其他字符串添加到原始字符串的开头或结尾
for(let i = 1; i < 32; i++) { if(i < 10) { console.log(`0{i}`) }else { console.log(i) } } for(let i = 1; i < 32; i++) { console.log(i.toString().padStart(2,0)) } for(let i = 1; i < 30020; i += 1000) { console.log(i.toString().padEnd(5, ‘*#‘)) }
标签:string col pad tar ade span console pre ++
原文地址:https://www.cnblogs.com/qjb2404/p/12231371.html