gitHub()

This web app is where you can experiment with JavaScript's built-in methods. I create custom code to help you understand how these methods work and how you can achieve similar results with your own logic.

Imagine you have a list of test scores, how would you find the highest test score from this list?

Built-in Method:

          
const testScores = [85, 78, 96, 89, 94, 91, 87, 90];
const highestScore = Math.max(...testScores);
console.log(highestScore);
//OutPut 96;
          
        

Custom Logic:

            
const testScores = [85, 78, 96, 89, 94, 91, 87, 90];
let highestScore = testScores[0];
for (let i = 1; i < testScores.length; i++) {
  if (highestScore < testScores[i]) {
    highestScore = testScores[i];
  }
}
console.log(highestScore);
//OutPut 96;
            
          

If you want to understand in depth, please visit this link: Click here.