[Solved] Why is my string getting repeatedly in this function?
[ad_1] Your for(var j=0; j < accentArray.length; j++) is meaningless. You are not using the j variable anywhere. You just make the inner codes run accentArray.length times. If you want to check if the string includes an accent, you could write if ([…str].some(c => accentArray.includes(c))) There is a better way to remove characters from a … Read more