It's not terribly clean, but you could use indexOf() and check if it returns -1. Better than breaking out a loop.
Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources. Cory Benfield discusses the evolution of ...