Is there a possibility to add comment inside a javascript multiline string?
Something like this:
var string = 'START - \
This is part of my string\
\\ This should be escaped!\
-END ';
// string = 'START - This is part of my string - END';
Thanks
I found one possibility:
var string ='START - \
This is my string'+
// This should be escaped!
' - END';
// string = 'START - This is my string - END'
But it's not so nice...
It's not possible this way. You can do:
var s = "multi line" +
//" line" +
" string";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With