Skip to content

Instantly share code, notes, and snippets.

@jboxman
Created May 29, 2017 00:26
Show Gist options
  • Save jboxman/f7b57d4c8343820c7208f2ac930ccd21 to your computer and use it in GitHub Desktop.
Save jboxman/f7b57d4c8343820c7208f2ac930ccd21 to your computer and use it in GitHub Desktop.
Kyle Simpson's example for tagged template literals in ES6
// https://github.com/getify/You-Dont-Know-JS/blob/master/es6%20%26%20beyond/ch2.md#tagged-template-literals
function foo(strings, ...values) {
console.log( strings );
console.log( values );
}
var desc = "awesome";
foo`Everything is ${desc}!`;
// [ "Everything is ", "!"]
// [ "awesome" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment