Expert Refresh

Replace all

1) Which is correct when replacing all?





2) Is this correct? keywords = "aba".split("a").join("b"); // bbb






<script> keywords = "php jquery".split(" ").join("+"); alert(keywords); // php+jquery </script> OR <script> keywords = "php jquery".replace(/ /g, "+"); // global alert(keywords); // php+jquery </script>


References



n/a