Find remaining indexes and storing them as values

I’m making a small game. You have to find the ball under a randomized cup. First the images are stored in a nodeList. Then the winning cup is calculated randomly from the length of the nodeList. My problem: After the random value for winningCup has been calculated I don’t know how to find the other two indexes from the ‘images’ nodeList. How can I calculate for two values that AREN’T the randomized winningCup’s value? My thought was to issue some kind of check, but I’m not sure what to check for. My goal for this is to have the two

Generate random string/characters in JavaScript

I want a 5 character string composed of characters picked randomly from the set [a-zA-Z0-9]. What’s the best way to do this with JavaScript? Answer I think this will work for you: