I'm trying to figure out a way to add some form of a delimiter to a long string in Javascript. For example, if I have a string of 26 characters (see below), is there a way for me to add a space or comma after every x (let's say in this case, every 3) number of characters in that string. Expected output: "abc def ghi jkl mno pqr stu vwx yz"
var str = "abcdefghijklmnopqrstuvwxyz";