Last active
January 3, 2024 08:22
-
-
Save xaliphostes/0509570267ad81339b47fac42a0a2df9 to your computer and use it in GitHub Desktop.
Tagged Template literal in ES6
This file contains hidden or 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
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates | |
// See https://tc39wiki.calculist.org/es6/template-strings/ | |
// | |
function ttl(strings, ...rest) { | |
console.log(rest); | |
} | |
ttl `a${1}b${2}c${3}`; | |
ttl `a${1}b${2}c${3}d${4}`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment