Counter={
create: function(max){
var o=Object.create(this)
o.max=max
return o
},
value: 0,
step: function(){
with(this) with(console){
if(value>=max) return log("done")
log(++value)
}
}
}
with(Counter.create(3)) step(), step(), step(), step()
with(Counter.create(5)) step(), step(), step(), step(), step(), step()