面向对象 js 打包

来源:互联网 发布:知乎 湖南农民考察报告 编辑:程序博客网 时间:2024/05/16 09:57

function StringBuffer(){

    this.__strings__ = new Array();

}

 

StringBuffer.prototype.append = function(str){

    this.__strings__.push(str);

}

 

StringBuffer.prototype.toString = functiong(){

    return    this.__strings__.join("");

}