Call function 'n' times in JavaScript
Sometimes you need to call a function a given number of times. There is no purpose-built function to do exactly this, but it can easily be done with Array:
// Log "hi" five times
Array.from({length: 5}, () => console.log('hi'));
// Get two random d...
jordanbrennan.hashnode.dev2 min read