Not having the target might be problematical as well, doesn't it? Instead, one could as well return an object containing the object AND the path. You could for example create your own prototype method: Creep.prototype.findMyClosest = function findMyClosest(args){ var target = this.findClosest(args); return {target:target,path:this.pos.findPathTo(target)}; }