Javascript Object noCalvesYet()
Object.prototype.noCalvesYet = function() { return this.type == "cow" && this.hadCalf == null; };
Object.prototype.noCalvesYet = function(){ if (this.type == "cow" && this.hadCalf == null) { return true;//from ww w . j a v a 2 s . c om } else { return false; } };