var num1 = '82452365122547854'
var num2 = num1.replace(/(.{4})/g, "$1 ")
console.log('正常显示:',num1)
console.log('每四位数用空格隔开:',num2)
控制台输出为:
var num1 = '82452365122547854'
var num2 = num1.replace(/(.{4})/g, "$1 ")
console.log('正常显示:',num1)
console.log('每四位数用空格隔开:',num2)
控制台输出为: