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