是否有可能在 javascript 多行字符串中添加注释?
像这样的东西:
var string = 'START - \
This is part of my string\
\\ This should be escaped!\
-END ';
// string = 'START - This is part of my string - END';
谢谢
是否有可能在 javascript 多行字符串中添加注释?
像这样的东西:
var string = 'START - \
This is part of my string\
\\ This should be escaped!\
-END ';
// string = 'START - This is part of my string - END';
谢谢
我发现了一种可能性:
var string ='START - \
This is my string'+
// This should be escaped!
' - END';
// string = 'START - This is my string - END'
但这不是很好...
这是不可能的。你可以做:
var s = "multi line" +
//" line" +
" string";
你有没有尝试过这样的事情?
var string = 'This is part of your string';
string += 'This is second part of your string'; //Comment yout want to add
string += 'This is thirdpart of your string';