|
|
|
@ -22,22 +22,11 @@ console.log(NumPattern());
|
|
|
|
numbers = [8,393,200,700,4,2000,638,29999]
|
|
|
|
numbers = [8,393,200,700,4,2000,638,29999]
|
|
|
|
|
|
|
|
|
|
|
|
function findMaximum(){
|
|
|
|
function findMaximum(){
|
|
|
|
let max = numbers[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let num of numbers){
|
|
|
|
|
|
|
|
if (max < numbers[i]){
|
|
|
|
|
|
|
|
max = numbers[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return max;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function findMaximum1(){
|
|
|
|
|
|
|
|
let max = 0;
|
|
|
|
let max = 0;
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < numbers.length; i++){
|
|
|
|
for (let num of numbers){
|
|
|
|
if (max < numbers[i]){
|
|
|
|
if (max < num){
|
|
|
|
max = numbers[i];
|
|
|
|
max = num;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return max;
|
|
|
|
return max;
|
|
|
|
@ -47,4 +36,4 @@ return max;
|
|
|
|
|
|
|
|
|
|
|
|
console.log(findMaximum())
|
|
|
|
console.log(findMaximum())
|
|
|
|
|
|
|
|
|
|
|
|
console.log(findMaximum1())
|
|
|
|
//console.log(findMaximum1())
|