Last active
August 29, 2015 14:25
-
-
Save muratpurc/db071f480d9beea19cda to your computer and use it in GitHub Desktop.
How to creating multi-line strings in JavaScript < ES6
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
// Alternative way to create a multi-line strings for ES < 6 | |
var text = (function () {/* | |
<html> | |
<body> | |
<div> | |
</div> | |
</body> | |
</html> | |
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]; | |
console.log('text', text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment