I started receiving this error in Firefox browser only. I assume that unsupported lookbehind inside this function is what causes the problem.
Invalid regexp group in Firefox
What is the other way i could achieve this regex's functionality (number thousand separator)?
function thousand_separator(x) {
return x.toString().replace(/\B(?<!\,\d*)(?=(\d{3})+(?!\d))/g, ".");
}