I am trying to replace all the /n, <br> and space in the string and replace them with ''.
My approach is using replace. However, I am getting the following errors.
Uncaught SyntaxError: Unexpected string
I know
console.log(text.value[langID]) would output bunch of texts.
but I got the error when I changed my codes to this.
console.log(text.value[langID].replace('/\n|<br>|\s/g', ''));
I am not sure what went wrong here and if my rex pattern can filter my requirements.
Can anyone gives me a hint?
Thanks so much!