This will replace the first occurrence.
a = a.replace("hello", "helloworld");
If you need to replace all occurrences, you will need a regular expression. (The flag gat the end means global, so it will find all occurrences.)
a = a.replace(/hello/g, "helloworld");