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