It works, but it's a little overkill :) You can pass the whole 'game' object to the function, that way you don't have to .find on the array. Also, be careful with ==, as a best practice try to use === that way you won't run into very hard to understand bugs with types! :D
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.