Javascript heredoc
I need something like heredoc in JavaScript. Do you have any ideas for this? I need cross-browser functionality. I found this: heredoc = '\ <div>\ <ul>\ <li><a href="#zzz">zzz</a></li>\ </ul>\ </div>'; I think it will work for me. :) No, unfortunately JavaScript does not support anything like heredoc. mko Try ES6 String Template , you can do something like var hereDoc = ` This is a Multiple Line String `.trim() hereDoc == 'This\nis\na\nMultiple\nLine\nString' => true You can use this great feature today by with 6to5 or TypeScript Zv_oDD How about this: function MyHereDoc(){ /*HERE <div> <p>