add a string in javascript code example Example 1: javascript add to string var s = 'hell' s = s + 'o' Example 2: append string js var s = "1" s += "2"