SOURCE

function SpecialArray(){
  var values = new Array(); //创建数组
  values.push.apply(values,arguments); //添加值
  values.toPipedString = function(){	//添加方法
    return this.join('|')
  }
  return values;
}
var colors = new SpecialArray("red","blue","green");
console.log(colors.toPipedString());
console 命令行工具 X clear

                    
>
console