Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Add template string example
Browse files Browse the repository at this point in the history
  • Loading branch information
sicktastic committed Sep 1, 2017
1 parent f8c932d commit bc1a496
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions es6/extreme-template-string.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
'use strict';

const student = { name: 'James', followerCount: 34 };
// const student = { name: 'James', followerCount: 34 };

let tableHtml = `
<table class="table">
<thead>
<tr>
<td>Name</td>
<td>Followers</td>
</tr>
</thead>
<tbody>
<tr>
<td>${student.name}</td>
<td>${student.followerCount}</td>
</tr>
</tbody>
</table>`;
// let tableHtml = `
// <table class="table">
// <thead>
// <tr>
// <td>Name</td>
// <td>Followers</td>
// </tr>
// </thead>
// <tbody>
// <tr>
// <td>${student.name}</td>
// <td>${student.followerCount}</td>
// </tr>
// </tbody>
// </table>`;

console.log(tableHtml);
// console.log(tableHtml);

const full_name = {
first_name: 'Anthony',
last_name: 'Lee'
};

let greeting = `<p>Hi, my name is ${full_name.first_name}. Nice to meet you! My last name is ${full_name.last_name}.</p>`;

console.log(greeting);

0 comments on commit bc1a496

Please sign in to comment.