I am trying to determine if any string in an array contains special characters. I have experimented with various methods like RegExp, test, includes, and contains, but none of them give me the desired outcome. Instead, they all return false for every string.
let prodList: string[] = ['H&W', 'Tony$Talk', 'GP', '(Test*)'];
specialCharactersList = '/[!@#$%^&*()+\\-=[]{};':\"|,.<>/?`~';
for(var i = 0; i < prodList.length ; i++)
{
console.log(prodList[i].includes(specialCharactersList));
console.log(prodList[i].contains(specialCharactersList));
}