Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

I have the following code in Ruby. I want to convert this code into JavaScript. what's the equivalent code in JS?

text = <<"HERE" This Is A Multiline String HERE

1 Answer

0 votes
by (106k points)
edited by

The ES6 has template literals which have many features, variable interpolation among others, so you can use them here:-

See the code below:-

var html = ` 

<div> 

<span>Some HTML here</span> 

</div> `;

Check out this Web Development Course to enhance your career! 

Related questions

Browse Categories

...