How to turn to jumps
?
function Animal(name) { var speed = 10 return { name: name, run: function() { alert(jumps) } } } function Rabbit(name) { var me = Animal(name) var jumps = 0 me.jump = function() { jumps++ } me.getJumps = function() { return jumps } me.constructor = arguments.callee return me }
var ogj = Rabbit ()