js自写字符串 append 方法

function stringbuilder()
{
  this.arr = new Array();
  this.append=function(str)
  {
    this.arr.push(str);
  }
  this.tostring = function()
  {
    return this.arr.join('');
  }
}

var sb = new stringbuilder();
sb.append("hello");
sb.append("doudou");
$("#div1").html(sb.tostring());

上一篇:docker镜像打包save,载入load,启动run


下一篇: