際際滷

際際滷Share a Scribd company logo
Template Strings | ES6
JAGADEESH PATTA ( PJ )
Agenda
 Introduction
 Syntax
 Live Examples
Introduction
 Template strings are string literals allowing embedded expressions.
 It supports single as well as multiline support.
 Template strings are enclosed by the back-tick ( ` ` ).
 The expressions are indicated by the Dollar sign and curly braces like $ {
expression }.
Syntax
 Single Line
` string text `
 Multi Line
` line one content
line two content `
 Expressions
` string message $ { expression } `;
Live Examples
 Single Line
console.log( ` string text ` );
 Multi Line
console.log(` line one content
line two content `);
 Expressions
var a = 10, b = 20;
Console.log(` string message $ { a + b } `);
Any Q?
Thank You

More Related Content

4. Template strings | ES6

  • 1. Template Strings | ES6 JAGADEESH PATTA ( PJ )
  • 3. Introduction Template strings are string literals allowing embedded expressions. It supports single as well as multiline support. Template strings are enclosed by the back-tick ( ` ` ). The expressions are indicated by the Dollar sign and curly braces like $ { expression }.
  • 4. Syntax Single Line ` string text ` Multi Line ` line one content line two content ` Expressions ` string message $ { expression } `;
  • 5. Live Examples Single Line console.log( ` string text ` ); Multi Line console.log(` line one content line two content `); Expressions var a = 10, b = 20; Console.log(` string message $ { a + b } `);