I am having trouble with my code. My deck of cards are in an array but when click next card once at the last card in the deck I get an error message. Same for when I hit the previous card button while at the beginning of the array. Is there a way to loop through the array so that once I hit the end of the array it will automatically go to the beginning of the array again?
I am having trouble with my code. My deck of cards are in an array but when click next card once at the last card in the deck I get an error message. Same for when I hit the previous card button while at the beginning of the array. Is there a way to loop through the array so that once I hit the end of the array it will automatically go to the beginning of the array again?