var unicode = ['!', '@', '%', '$', '#', '^', '&', '*', '(', ')', '-', '_', '+', '=', '{', '}', '[', ']', '\\', '|', ':', ';', '\'', '"', ',', '<', '>', '.', '/', '?', '~', '`'];
var removeunicode = "my message!!@!(@^!@&(*";
for (var i = 0; i < unicode.length; i++) {
removeunicode = removeunicode.replace(new RegExp(unicode[i], 'g'), "");
}
No idea what's the problem here, looks perfectly fine, basically its stripping all the unicode off the message I put, and RegExp seems to be messing around with me giving me
SyntaxError: Invalid regular expression: /*/: Nothing to repeat
can anybody help me? :)