I have just run a very simple JavaScript performance test (don\'t ask why). The test declares a variable, but doesn\'t assign anything to it:
var x;
I recently discovered that this:
if (typeof this._minLat === 'undefined') { this._minLat = Math.min(...this.points.map(point => point.lat)); } return this._minLat;
seems to be many times faster than this:
return this._minLat || Math.min(...this.points.map(point => point.lat));