Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MyBits4U authored Oct 11, 2017
1 parent ce637a0 commit e97686a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templateliterals.html
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>
27 changes: 27 additions & 0 deletions templateliterals.js
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);

0 comments on commit e97686a

Please sign in to comment.