I have an array full of names and am trying to get rid of any " ' " symbols because I am pulling the array in to a SQL statement and the " ' " is messing up my query.
My thought was to use replace but I have been messing around with it and it doesn't seem to be working. Any thoughts?
var names = ["Ben Smith", "Richard Brown", "Michael O'Donnell"]
for(var z = 0; z<names.length; z++){
if(names[z].includes("'")){
names[z].replace("'", "")
}
}
return names