Triple-strings

Dmitry A. Soshnikov dmitry.soshnikov at gmail.com
Wed Aug 24 02:44:54 PDT 2011


Hi again,

And another topic which I'd like to separate from the doc-comments topic 
is the "triple-strings". The rationale is not to escape the 
double/single quotes when describing something bigger than one line 
(usually these are comments, but other simple strings with many of 
double quotes are also the case).

var description = " This is \"ECMAScipt\", \"The language of the 'Web' \" ".

vs.

var description = ' This is "ECMAScript", "The language of the \'Web\' " '

vs.

var description = """ This is "ECMAScript", "The language of the 'Web' " """

It also may continue to new lines without escaping and concatenation:

  " This is \"ECMAScipt\",\" +
"\"The language of the 'Web' \" ".

vs.

""" This is "ECMAScript",
"The language of the 'Web' """"

?

Dmitry.


More information about the es-discuss mailing list