how to add letters to a string javascript code example

Example 1: how to concatenate strings and variables in javascript

const helloName = name => `Hello ${name}!`

Example 2: 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 3: javascript string concatenation

var totn_string = '';

console.log(totn_string.concat('Tech','On','The','Net'));

//The following will be output to the web browser console log:

TechOnTheNet