// What is good code? --> Readable and Scalable.
// Scalable is Big O.
// Give the instruction to computer --> Output( for example: turn on the light)
// As our array grows, our function take longer time to run to finish the task. --> Depend on your CPU and lots of factor affects our runtime.
// Big O Notation is the speaking of how long the function is going to run to perform a task --> which one is better in scaling, faster to run
const nemo = ['nemo'];
function findNemo(array) {
let t0 = performance.now();
for (let i = 0; i < array.length; i++) {
if (array[i] === 'nemo') {
console.log('found NEMO!');
}
}
let t1 = performance.now();
console.log('Call to find Nemo took ' + (t1 - t0) + 'miliseconds');
}
findNemo(nemo);