-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Template literals</title> | ||
</head> | ||
<body> | ||
|
||
|
||
<script src="templateliterals.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
// Single line | ||
let greeting = `Hello`; | ||
|
||
|
||
// Multi line | ||
|
||
let helloWorld = `Hello | ||
World`; | ||
console.log(helloWorld); | ||
|
||
var helloWorldOld = 'Hello\nWorld'; | ||
console.log(helloWorldOld); | ||
|
||
// Expressions | ||
let course = `ES6`; | ||
const url = 'https://developer.mozilla.org/en-US/'; | ||
console.log (`Cursus: ${course}`); | ||
|
||
const es6 = `<article> | ||
<h3>${course} is the new standard of JavaScript</h3> | ||
<p>You can find more at ${url}.</p> | ||
</article>`; | ||
|
||
document.write(es6); |