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 even in older browsers with TypeScript
More Related Contents:
- Creating multiline strings in JavaScript
- How to create a translucent in React Native?
- jQuery AJAX cross domain
- Detect browser or tab closing
- How to access POST form fields in Express
- How to create an array containing 1…N
- How to get value of selected radio button?
- How to loop through an array containing objects and access their properties
- How to check if a string contains text from an array of substrings in JavaScript?
- How to get a file or blob from an object URL?
- Cancel a vanilla ECMAScript 6 Promise chain
- Why define an anonymous function and pass it jQuery as the argument?
- Google Chromecast sender error if Chromecast extension is not installed or using incognito
- D3js – change Vertical bar chart to Horizontal bar chart
- Referencing a JavaScript value before it is declared – can someone explain this
- How to make supported on all browsers? Any alternatives?
- Updating source URL on HTML5 video with React
- Implementing Google Translate with custom flag icons
- Running Javascript in new window.open
- Protractor: element.getText() returns an object and not String
- How can I expand and collapse a using javascript?
- Is there any way to get Firebase Auth User UID?
- How to use rowspan and colspan in tbody using datatable.js?
- CSS Textarea that expands as you type text [duplicate]
- JavaScript to get rows count of a HTML table
- script links without href=”#”
- Angular passing scope to ng-include
- Is there any way to check reachability test of server in jQuery
- Generate XML document in-memory with JavaScript
- How to understand JS realms