javascript append character to string code example
Example 1: how to add a letter to a string javascript
String.prototype.splice = function(idx, rem, str) {
return this.slice(0, idx) + str + this.slice(idx + Math.abs(rem));
};
var result = "foo baz".splice(4, 0, "bar ");
document.body.innerHTML = result; // "foo bar baz"
Example 2: javascript add to string
var s = 'hell'
s = s + 'o'