-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs for tagged template literals (#4372)
* Correct tagged template literal test. Should use Coffeescript form of interpolated strings, not Javascript! * First pass at docs for tagged template literals. * Correct alerted variable. * Add note re checking runtime for tagged template literals * Fixed broken example. * Consistent style * Clarify that CoffeeScript isn’t handling the tagged template literal, the runtime is; fix CoffeeScript spelling * Collapse notes about generator functions and tagged template literals into the same sentence * Make tagged template literals example into a function * Make text less clunky. * More clarity on what CoffeeScript is doing versus what the runtime is doing, and emphasize runtimes vs Babel/Traceur
- Loading branch information
1 parent
992eb49
commit 555e47d
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
upperCaseExpr = (textParts, expressions...) -> | ||
textParts.reduce (text, textPart, i) -> | ||
text + expressions[i - 1].toUpperCase() + textPart | ||
|
||
greet = (name, adjective) -> | ||
upperCaseExpr""" | ||
Hi #{name}. You look #{adjective}! | ||
""" |
This file contains 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
This file contains 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