Template tags, String fn keywords

String Functions

by manoj_antony32

JavaScript

var x = 'Bond';
var result = `hello ${x}, james ${x}`;
console.log(result)

let one = 1;
let two = 2;
console.log(`Adding ${one} and ${two} gives me ${one + two}`);

let y = function(strArray,...n){
	console.log(strArray);
  console.log(n);
};
y`Adding and ${two} gives me`;

console.log('hello world'.startsWith('hell'));
console.log('hello world'.endsWith('orl'));
console.log('hello world'.includes('wor'));
console.log('hello world\n'.split('').reverse().join(''));
var row = String.raw`Not a newLine:\n`;
console.log(row)