This magic regex will separate a string into groups of 4 characters (or less if in the end the group is smaller)
'12345678910'.match(/.{1,4}/g).join('-')
Output: "1234-5678-910"
HTML, CSS and JavaScript
This magic regex will separate a string into groups of 4 characters (or less if in the end the group is smaller)
'12345678910'.match(/.{1,4}/g).join('-')
Output: "1234-5678-910"