This could be a good time to make use of some higher level array methods, such as [.forEach() and [url="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some"].some()](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach)

After reordering things to remove the need for the temp array, here's what we get: