<p><pre><code> ['red', 'blue', 'yellow'].find((d, i) => i === Math.round(Math.random() * 2))
</code></pre>
That's not a safe way to pick a random color from an array.<p>`Math.round(Math.random() * 2)` might produce the following sequence: 2, 2, 0. The find callback is called with 0, 1, 2, so it returns nothing.<p>Maybe they were going for:<p><pre><code> ['red', 'blue', 'yellow'][Math.round(Math.random() * 2)]
</code></pre>
If they intended for `undefined` or `null` to be a valid result, then it would be better to write:<p><pre><code> ['red', 'blue', 'yellow', null][Math.round(Math.random() * 3)]
</code></pre>
Haha, I submitted a PR: <a href="https://github.com/tannerlinsley/react-move/pull/1" rel="nofollow">https://github.com/tannerlinsley/react-move/pull/1</a>