FindNemo_performance

Run Settings
LanguageJavaScript
Language Version
Run Command
const fish = ['dory', 'bruce', 'marlin', 'nemo']; const nemo = ['nemo']; const everyone = ['dory', 'bruce', 'marlin', 'nemo', 'gill', 'bloat', 'nigel', 'squirt', 'darla', 'hank']; const large = new Array(1000).fill('nemo'); function findNemo2(fish) { let t0 = performance.now(); for (let i = 0; i < fish.length; i++) { if (fish[i] === 'nemo') { console.log('Found NEMO!'); } } let t1 = performance.now(); console.log("Call to find Nemo took " + (t1 - t0) + " milliseconds."); } //findNemo2(large) //JS ES6 const boxcompress = boxes =>{ boxes.forEach(box=>console.log(box)); } //JS ES5 function boxCompress(boxes){ boxes.forEach(function compress(box){console.log(box)}) } boxcompress(everyone) boxCompress(everyone) const boxconst = (boxes) =>{ console.log(boxes[0]+" "+boxes[1]); } boxconst(everyone)
Editor Settings
Theme
Key bindings
Full width
Lines