phpjavascriptphpjs

remove quotes from variable in javascript?


I really don't understand Javascript.

In PHP, I can remove quotes like this:

$tags_array = preg_replace('/"/', '', $tags_array);

How do I write it in Javascript?


Solution

  • str = str.replace(/"/g, '');