javascript - Using String.raw() with Node JS -


i'm working on node.js app , use string.raw() part of es 6 standard.

however, when using in documentation:

text = string.raw`hi\n${2+3}!` + text.slice(2); 

it returns syntaxerror: unexpected token illegal character after string.raw.

i think there problem because string.raw() new technology available chrome , firefox yet. however, can use in node.js , how?

the grave character after raw denotes template strings, feature in es6 harmony. can invoke node --harmony flag, feature not yet implemented. reason of syntax error. raw strings unsupported too. if want experimenting feature in server side, check out io.js, fork of node, many es6 features implemented , enabled default.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -