I'm struggling with putting a dot after each 3 numbers in JavaScript.
I know that it should be done using regex and I should use join method? But can someone please tell me how to implement that?
My idea for now is to do like that:
let num=12312;
let res=num.replace(/(.{3}/g,".");
console.log(res);
But that's not working. Thank you in advance!