I have a number of unknown length and i need to format it by adding comma after every 3rd number from the right (so 12345678 becomes 12,345,678). As of now i'm using this chaos to do it
value.toString().split('').reverse().join('').match(/.{1,3}/g).reverse().map( (num) => num.split('').reverse().join('') ).join()
Is there any cleaner way to do it with native functionality?