Skip to content

Commit 20d0213

Browse files
committed
ES6 literal template example
1 parent 030f47b commit 20d0213

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

chapter01/12-Es6StringTemplates.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="12-Es6StringTemplates.js"></script>
9+
10+
</body>
11+
</html>

chapter01/12-Es6StringTemplates.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Template literals
2+
var book = {
3+
name: 'Learning JavaScript DataStructures and Algorithms'
4+
};
5+
6+
console.log(`You are reading ${book.name}.,
7+
and this is a new line`);

0 commit comments

Comments
 (0)