Joined July 2012
·
Posted to
Get nearest entity
over 1 year
ago
Sin loop:
var that = this;
return Math.min.apply(ig.game.entities.map(function () {
return this.distanceTo(that);
}));
Achievements
149 Karma
4,922 Total ProTip Views

Honey Badger
Have at least one original Node.js-specific repo

Nephila Komaci 3
Have at least three original repos where PHP is the dominant language

Nephila Komaci
Have at least one original repos where PHP is the dominant language

Charity
Fork and commit to someone's open source project in need

Cub
Have at least one original jQuery or Prototype open source repo
There could be a race condition in here... What if my function execution ends after the current .$apply has called $diggest in order to refresh the scope? This is the case when we call .safeApply when something is already happening on .$apply, as you can see on the conditional, it will just simply execute the function.