I have a string with comma separated values:
var x = '1,2,10,11,12';
I need to remove the value that’s in y.
x = remove(x,y);
Q: Is there a function for that already or do I need to convert it to an array, remove y and then convert it back to a string?
You can do
x.replace(y, ""). For more information, see the Mozilla docs.