Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5993145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:37:59+00:00 2026-05-22T23:37:59+00:00

With the rise of node.js, multi-line strings are becoming more necessary in JavaScript. Is

  • 0

With the rise of node.js, multi-line strings are becoming more necessary in JavaScript.

  1. Is there a special way to do this in Node.JS, even if it does not work in browsers?
  2. Are there any plans or at least a feature request to do this that I can support?

I already know that you can use \n\ at the end of every line, that is not what I want.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:38:00+00:00Added an answer on May 22, 2026 at 11:38 pm

    node v4 and current versions of node

    As of ES6 (and so versions of Node greater than v4), a new “template literal” intrinsic type was added to Javascript (denoted by back-ticks “`”) which can also be used to construct multi-line strings, as in:

    `this is a 
    single string`
    

    which evaluates to: 'this is a\nsingle string'.

    Note that the newline at the end of the first line is included in the resulting string.

    Template literals were added to allow programmers to construct strings where values or code could be directly injected into a string literal without having to use util.format or other templaters, as in:

    let num=10;
    
    console.log(`the result of ${num} plus ${num} is ${num + num}.`);
    

    which will print “the result of 10 plus 10 is 20.” to the console.

    Older versions of node

    Older version of node can use a “line continuation” character allowing you to write multi-line strings such as:

    'this is a \
    single string'
    

    which evaluates to: 'this is a single string'.

    Note that the newline at the end of the first line is not included in the resulting string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to send array of strings from JavaScript to PHP? I
I've seen this question rise here and there a few times, but I never
Dynamic languages are on the rise and there are plenty of them: e.g. Ruby,
How come this doesn't rise Attribute error? function object doesn't have any of the
Given this bug (Python Issue 4892) that gives rise to the following error: >>>
Is there a way of putting Semaphore obj into a wait mode? For example,
is there a way for an app to get notified when a new email
I have written one JavaScript function which would rise the event when the User
With the rise of multicore CPUs on the desktop, multithreading skills will become a
With the upcoming rise of AJAX applications on the web, I wrote some own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.