diff --git a/js/index.js b/js/index.js index 59e4af7fb..3d50a349d 100644 --- a/js/index.js +++ b/js/index.js @@ -1,6 +1,236 @@ -// Iteration 1: Names and Input -// -// Iteration 2: Conditionals +// Iteration #1: Find the maximum - -// Iteration 3: Loops +function maxOfTwoNumbers(number1, number2) { + if(number1>number2){ + return number1; + } + else if(number1 array[i].length){ + + } + else{ + ganador = array[i]; + } + } + return ganador; + } + + let findLongestWordResult = findLongestWord(words); + console.log(`Iteration 2, answer: ${findLongestWordResult}`); + + + + + // Iteration #3: Calculate the sum + const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10]; + let resultadoSuma=0; + + function sumNumbers(array) { + + for(let i=0;i