I have an array like this:
["ee", "3/4\"", "22\"", "22\""]
and I would like to either remove the commas, \"
, or replace them with "
so that the array looks like this:
["ee", "3/4", "22", "22"]
or that:
["ee", "3/4"", "22"", "22""]
The reason is because I'm trying to pass this array from Ruby to JavaScript, but I keep getting the error message "Unterminated string constant" and I just can't figure out how to do this!
This is what I use to pass information to JavaScript:
cut_list="from_ruby_cut(\""+c[1]+"\")"
source share