Skip to main content
100%

Create an array of between 1 and 100 numbers that are between 1 and 100 iterate over and keep the largest number.

✓ Published0🌍 Public
Aandrewcowley
Last edited Jun 23, 2013
Created on Jun 23, 2013

This example demonstrates how to find the largest number in a randomly generated array of between 1 and 100 integers, each also ranging from 1 to 100. It uses plain JavaScript with a custom `findLargest` function that iterates through the array, comparing each value against a running maximum and logging each comparison to the console. The code relies on the native `Math.random`, `Math.floor`, and `Array.push` methods to construct the dataset, then outputs the final result as a string. No external libraries or visualization frameworks are used; the example is purely algorithmic.

AI-generated description

Similar vizzes