Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
([count, direction], otherBoid) => {
const d = Vector.dist(boid.position, otherBoid.position);
return d > 0 && d < CONFIG.neighbourDist
? [count + 1, direction.add(otherBoid.position)]
: [count, direction];
},
[0, new Vector(0, 0)],