1String.prototype.trimEllip = function (length) {
2 return this.length > length ? this.substring(0, length) + "..." : this;
3}
1(function() {
2 strings = ["z"];
3 try {
4 while(true) {
5 strings.push(strings[strings.length - 1] + strings[strings.length - 1]);
6 }
7 } catch(err) {
8 var k = strings.length - 2;
9 while(k >= 0) {
10 try {
11 strings.push(strings[strings.length - 1] + strings[k]);
12 k--;
13 } catch(err) {}
14 }
15 console.log("The maximum string length is " + strings[strings.length - 1].length);
16 }
17})();