Skip to content

Commit

Permalink
i is changed to start from 1
Browse files Browse the repository at this point in the history
  • Loading branch information
yinxoxo committed Jun 27, 2024
1 parent b417aa4 commit a8950b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Week2/Assignment1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function max(numbers) {
let maxNumber = numbers[0];
for (let i = 0; i < numbers.length; i++) {
for (let i = 1; i < numbers.length; i++) {
if (numbers[i] > maxNumber) {
maxNumber = numbers[i];
}
Expand Down

0 comments on commit a8950b5

Please sign in to comment.