If you are like me, adding regularity to replaceAll may cause this error to be reported.
You can use the replace method. If you want to replace all the regular expressions, add /g after the regular expression
let reg=/\(|-|\)|\s/g;
$("#telphone").val(number.toString().replace(reg,''));