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);