Created
June 26, 2015 17:42
-
-
Save fentas/fa79167a82bf15160421 to your computer and use it in GitHub Desktop.
Multi-line strings in JavaScript and Node.js
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
var html = (function () {/* | |
2 <!DOCTYPE html> | |
3 <html> | |
4 <body> | |
5 <h1>Hello, world!</h1> | |
6 </body> | |
7 </html> | |
8 */}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]; |
let html =
`<html>
<h1>Yo Yoda!</h1>
</html>`
Then browserify script.js -t babelify --outfile bundle.js
=)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://tomasz.janczuk.org/2013/05/multi-line-strings-in-javascript-and.html