dimanche 22 février 2015

Should I shorten long strings into shorter sub strings?

I heard at someplace that I can't remember right now, than it was a smart idea to shorten longer strings into shorter substrings. Should I do this? What are the pros, and cons?


Sample:



var string = "some extremly long string for the sample I am making for this Stack Overflow question. Must add more words to make longer.";
alert(string);


or



var string1 = "some extremely long string";
var string2 = "for the sample I am making";
var string3 = "for this Stack Overflow question.";
var string4 = "Must add more words to make longer.";
alert(string1 +string2 +string3 +string4);

Aucun commentaire:

Enregistrer un commentaire