let foo = Array.from({length: 10000}, () => Math.floor(Math.random() * 40));
let g; for (i=0; i<foo.length; i++) { g = Math.random(); }
let g; const f=() => {g = Math.random()} foo.forEach(f)