LoginSignup
0
0

More than 5 years have passed since last update.

template literal example (es2015)

Posted at

template literal example (es2015)

{
    const placeholder = `placeholder`;
    const understand = `this is template literal with \`back-tick\`. this is also ${placeholder } statement is replace from variables.
and enables to start newline without \\n statement.`
    const literal =()=>{return `in nested literal, enables to evaluate JavaScript itself`};
    const nestedLiteral = `this is nested ${literal()}`;
    console.log(understand);
    //this is template literal with `back-tick`. this is also placeholder statement is replace from variables.
    //and enables to start newline without \n statement.
    console.log(nestedLiteral);
    //this is nested in nested literal, enables to evaluate JavaScript itself
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0