mercredi 25 mars 2015

replacing a text with "$$$", gives truncated result in Javascript


var text="$$$ $$ $";
var dummy="hello world";
dummy.replace("world", text);


expected output:



hello $$$ $$ $


actual output:



hello $$ $ $


i don't understand why this is happening. kindly help. it doesn't seem to happen with other symbols though.


thanks


Aucun commentaire:

Enregistrer un commentaire