0

i have a text.txt file in which is text like this

20x3x11
15x27x5
6x29x7

How to assign that to javascript string? When i am doing :

var input = "20x3x11
    15x27x5
    6x29x7";

    console.log(input);

i am getting in console error - Uncaught SyntaxError: Invalid or unexpected token

Thanks for answers and help in advance!

bafix2203
  • 541
  • 7
  • 25

1 Answers1

1

You can use ticks ` for multiline strings.... e.g.

var a = ` hi
this 
works`
Uzer
  • 3,054
  • 1
  • 17
  • 23