diff --git a/src/functions-and-arrays.js b/src/functions-and-arrays.js index 18c9498..1039563 100644 --- a/src/functions-and-arrays.js +++ b/src/functions-and-arrays.js @@ -1,18 +1,106 @@ // Progression #1: Greatest of the two numbers - +function greatestOfTwoNumbers(num1,num2){ + if(num1>num2) + {return num1;} + else + {return num2;} +} // Progression #2: The lengthy word const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot']; - +function findScaryWord(words){ + if(words.length==0){ + return null; + } + for(i=0;i