var zOrder = 0; dojo.forEach(this.cache, function(item){ zOrder += item.z;} ); return (this.cache.length > 1) ? zOrder / this.cache.length : 0;