I tried to randomize the venues retrieved by the Foursquare API by incorporating a randomizer function (shuffleArray()). Initially I put this function in main.js and later moved it to helper.js
What I am doing is creating a new variable randomizedArray in the renderVenues() function. As its value I’m assigning the outcome of shuffleArray() with venues as its argument. In the remainder of the renderVenues function this variable randomizedArray is not used but somehow when I refresh the webpage with the same location I get different venues. I would have expected to need the randomizedArray variable for assigning a value to the const venue and in the $destination.append() line. However when I do that I don’t get venue results on the webpage.
So how is it working?
And how are the helper.js and main.js linked to eachother? There is no export and import in the files?