Shuffle the Cards

Learn to use the spread and random methods to shuffle the cards.

In the shuffleCard function, we shuffle our CardImages in a random order and use the button in the Header component to create a new game any time a user clicks it. To define the shuffleCard function, we use CardImages, which is a collection of flags from various countries that have already been passed for us to use in the App.js component. We use the ...