Something went wrong. Try again.
First challenge from Josh Comeau's course The Joy of React.
react game
Something went wrong. Try again.
319 B · 15 lines
JavaScript
at main
12345678910111213141516export const sample = (arr) => { return arr[Math.floor(Math.random() * arr.length)];};
export const range = (start, end, step = 1) => { let output = []; if (typeof end === 'undefined') { end = start; start = 0; } for (let i = start; i < end; i += step) { output.push(i); } return output;};