Template String

ES5: 

function getMessage() {
    const year = new Date().getFullYear();
    return "The year is " + year; 
};

ES6:

function getMessage() {
    const year = new Date().getFullYear();
    return `The year is ${year}`; 
};

results matching ""

    No results matching ""