SOURCE

var add = function(a,b){
  return a + b;
};
var myObject = {
  value : 3,
	increment:function(inc){
    this.value += typeof inc === 'number'?inc : 1;
  }
};
myObject.double = function(){
  var helper = function(){
    this.value = add(this.value,this.value);
  };
  helper();
};
myObject.double();
console.log(myObject.value);
console 命令行工具 X clear

                    
>
console