Yeah, it gets weird. Any even number of backticks in a row is a valid JavaScript expression. ``````````````````````````````````````
-
-
-
As long as you prefix that with an expression that resolves to a function
- 1 more reply
New conversation -
-
-
sadly it'll explode in browsers that don't support template literals, and you can't try/catch a syntax error :( So, babel
-
You can try/catch a syntax error: try { Function(code); success(); } catch (exception) { failure(); }
- 1 more reply
New conversation -
-
-
Only if you ignore browsers that don't understand templates & const ;)
-
Whether a piece of code is valid JavaScript or not is independent of any one browser. +
@jspedant - 3 more replies
New conversation -
-
-
Sure. As long as you return a function you're basically inventing your own flavor of Array#reduce
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
wat
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@aemkei vomit.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
tagged-tagged-[...tagged] Template Strings. Useful for curried functions! where all arguments are strings.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.