I want to show the type is 123 456 789 after I get the string 123456789. I used the method like following, but I do not think it is a great way, so does anyone has a better way ?
let num = '123456789'
let result = num.slice(0,3)+ ' '+num.slice(3,6)+ ' '+num.slice(6,9) // result = '123 456 789'