Big-O - Lx1
const nemo = ['nemo'];
function findNemo(array) {
let t0 = performance.now()
let i = 0
while (i++) {
if (array[i] === 'nemo') {
console.log('Found NEMO!')
break;
}
}
let t1 = performance.now()
console.log('call to find Nemo took: ' + (t1-t0) + 'millionseconds')
}
findNemo(nemo);INFO