File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Document</ title >
7+ </ head >
8+ < body >
9+ < h1 id ="showMessage "> </ h1 >
10+ <!-- link javacript file -->
11+ < script src ="js/script.js "> </ script >
12+
13+ </ body >
14+ </ html >
Original file line number Diff line number Diff line change 1+ // Template Literals(New Feature of ES6)
2+ // Backtick ``
3+ // Template Strings use back-ticks (``) rather than the quotes ("") to define a string:
4+ // Template Strings allow both single and double quotes inside a string:
5+ console . log ( `Hello, "Aktaruzzaman"` ) ;
6+ console . log ( `Hello, 'Aktaruzzaman'` ) ;
7+
8+ // Template Strings allow multiline strings:
9+ let text = `I wanna write a poems
10+ But I have no coins
11+ How can publich poems
12+ Give me some coins for writing poems` ;
13+
14+ console . log ( text ) ;
15+
16+ // Interpolation
17+ // Template String provide an easy way to interpolate variables and expressions into strings. The method is called string interpolation.
18+
19+ // The syntax is: ${..}
20+
21+ // Variable Substitutions: Template Strings allow variables in strings:
22+ let fisrtName = 'Aktaruzzaman' ;
23+ let middleName = "Al" ;
24+ let lastName = "Fatih" ;
25+
26+ console . log ( `Name: ${ fisrtName } ${ middleName } ${ lastName } ` ) ;
27+
28+ let a = 10 ;
29+ let b = 20 ;
30+
31+ console . log ( `${ a } + ${ b } = ${ a + b } ` ) ;
32+
You can’t perform that action at this time.
0 commit comments