12 lines
273 B
JavaScript
12 lines
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("");
|
||
|
};
|