12 lines
No EOL
273 B
JavaScript
12 lines
No EOL
273 B
JavaScript
function StringBuffer() {
|
|
this.buffer = [];
|
|
}
|
|
|
|
StringBuffer.prototype.append = function append(string) {
|
|
this.buffer.push(string);
|
|
return this;
|
|
};
|
|
|
|
StringBuffer.prototype.toString = function toString() {
|
|
return this.buffer.join("");
|
|
}; |