7

In Python, there are these triple quotation marks ('''), for multiple line strings, which is very useful. Is there any way to do this in javascript?

1
  • You can use the backticks instead of regular quotation mark to add multiline strings. Commented Jul 9, 2020 at 3:30

1 Answer 1

10

You can use the template literal. Encase your strings in backticks (`)

For your reference, check: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Sign up to request clarification or add additional context in comments.

2 Comments

thanks, but i can't acept an answer just yet.. sorry it says that you can accept an answer in 4 minutes
Thank you for accepting it. Glad I could help. Happy coding!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.