String Methods:
For this page, all functions will use the following strings:
let firstString = `I am`;
let secondString = `in love with Javascript`;
let thirdString = `even though I am finding it challenging!`;
- Concatenation:
- Interpolation
The + operator:
let newString = firstString + secondString + thirdString;
The .concat() method:
let newString = firstString.concat(secondString, thirdString);
The ES6 template literal method:
let newString = ${firstString secondString thirdString};
The + operator:
let newString = "text" + \n + "text" + firstString + " " + secondString + ", " + thirdString;
The ES6 template literal method:
let newString = `text ${firstString} ${secondString}, ${thirdString};