Created
March 23, 2016 01:51
-
-
Save lricoy/d78961e4fe4c27957e39 to your computer and use it in GitHub Desktop.
ES2015 Template String
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
// Criação de string literal básica (Basic literal string creation) | |
// Reparem que não é apóstofre (aspas simples) ou aspas, mas o ascento grave (`) | |
`This is a pretty little template string.` | |
// String de linhas múltiplas (Multiline strings) | |
`In ES5 this is | |
not legal.` | |
// Interpolação de variáveis (Interpolate variable bindings) | |
// Muito parecido com string.format do python | |
var name = "Bob", time = "today"; | |
`Hello ${name}, how are you ${time}?` | |
// Unescaped template strings | |
String.raw`In ES5 "\n" is a line-feed.` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment