diff --git a/exercises/001-isOldEnoughToDrink/app.js b/exercises/001-isOldEnoughToDrink/app.js index c4d3bab4d..781d9124d 100644 --- a/exercises/001-isOldEnoughToDrink/app.js +++ b/exercises/001-isOldEnoughToDrink/app.js @@ -1,4 +1,6 @@ function isOldEnoughToDrink(age) { // your code here - + return age >= 21 } + +console.log(isOldEnoughToDrink(23)) \ No newline at end of file diff --git a/exercises/002-isOldEnoughToDrive/app.js b/exercises/002-isOldEnoughToDrive/app.js index 0ab7348dd..317bfbfd3 100644 --- a/exercises/002-isOldEnoughToDrive/app.js +++ b/exercises/002-isOldEnoughToDrive/app.js @@ -1,4 +1,5 @@ function isOldEnoughToDrive(age) { // your code here - + return age >= 16 } +console.log(isOldEnoughToDrive(6)) \ No newline at end of file diff --git a/exercises/003-isOldEnoughToVote/app.js b/exercises/003-isOldEnoughToVote/app.js index 63c4efb41..81a07aaf0 100644 --- a/exercises/003-isOldEnoughToVote/app.js +++ b/exercises/003-isOldEnoughToVote/app.js @@ -1,4 +1,5 @@ function isOldEnoughToVote(age) { // your code here - + return age >= 18 } +console.log(isOldEnoughToVote(6)) \ No newline at end of file diff --git a/exercises/004-isOldEnoughToDrinkAndDrive/app.js b/exercises/004-isOldEnoughToDrinkAndDrive/app.js index c8c52473a..ae49a9e7c 100644 --- a/exercises/004-isOldEnoughToDrinkAndDrive/app.js +++ b/exercises/004-isOldEnoughToDrinkAndDrive/app.js @@ -1,4 +1,4 @@ function isOldEnoughToDrinkAndDrive(age) { // your code here - + return false } diff --git a/exercises/005-checkAge/app.js b/exercises/005-checkAge/app.js index 0ff57081e..6ab9db077 100644 --- a/exercises/005-checkAge/app.js +++ b/exercises/005-checkAge/app.js @@ -1,4 +1,10 @@ function checkAge(name, age) { // your code here - + if (age < 21) { + return "Go home, " + name + "!"; + } else { + return "Welcome, " + name + "!"; + } } +console.log(checkAge("Adrian", 22)); + diff --git a/exercises/006-getFullName/app.js b/exercises/006-getFullName/app.js index e8d8b83a8..6f0fa8532 100644 --- a/exercises/006-getFullName/app.js +++ b/exercises/006-getFullName/app.js @@ -1,4 +1,6 @@ function getFullName(firstName, lastName) { // your code here - + return firstName + " " + lastName } + +console.log(getFullName("Paco","Ruiz")) \ No newline at end of file diff --git a/exercises/007-getLengthOfWord/app.js b/exercises/007-getLengthOfWord/app.js index 8d04d4f58..19540e761 100644 --- a/exercises/007-getLengthOfWord/app.js +++ b/exercises/007-getLengthOfWord/app.js @@ -1,4 +1,6 @@ function getLengthOfWord(word) { // your code here - + + return word.length } +console.log(getLengthOfWord("Emilio")) diff --git a/exercises/008-getLengthOfTwoWords/app.js b/exercises/008-getLengthOfTwoWords/app.js index 032c8cff4..411783c96 100644 --- a/exercises/008-getLengthOfTwoWords/app.js +++ b/exercises/008-getLengthOfTwoWords/app.js @@ -1,4 +1,4 @@ function getLengthOfTwoWords(word1, word2) { // your code here - + return word1.length + word2.length } diff --git a/exercises/009-getLengthOfThreeWords/app.js b/exercises/009-getLengthOfThreeWords/app.js index 9049a6d5d..f1efe2f4f 100644 --- a/exercises/009-getLengthOfThreeWords/app.js +++ b/exercises/009-getLengthOfThreeWords/app.js @@ -1,6 +1,6 @@ function getLengthOfThreeWords(word1, word2, word3) { // your code here - + return word1.length + word2.length + word3.length } let output = getLengthOfThreeWords('some', 'other', 'words'); diff --git a/exercises/010-isSameLength/app.js b/exercises/010-isSameLength/app.js index 6ebc804ae..09f4e4c82 100644 --- a/exercises/010-isSameLength/app.js +++ b/exercises/010-isSameLength/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function isSameLength (word1,word2) { +return word1.length == word2.length +} \ No newline at end of file diff --git a/exercises/011-isGreaterThanTen/app.js b/exercises/011-isGreaterThanTen/app.js index b60c49b11..2d274bf74 100644 --- a/exercises/011-isGreaterThanTen/app.js +++ b/exercises/011-isGreaterThanTen/app.js @@ -1,4 +1,4 @@ function isGreaterThanTen(num) { // your code here - + return num > 10 } diff --git a/exercises/012-isLessThanThirty/app.js b/exercises/012-isLessThanThirty/app.js index a9612b873..f1a73962c 100644 --- a/exercises/012-isLessThanThirty/app.js +++ b/exercises/012-isLessThanThirty/app.js @@ -1,4 +1,4 @@ function isLessThan30(num) { // your code here - + return num < 30 } diff --git a/exercises/013-equalsTen/app.js b/exercises/013-equalsTen/app.js index 0d5c28e62..25c7bf3e5 100644 --- a/exercises/013-equalsTen/app.js +++ b/exercises/013-equalsTen/app.js @@ -1,4 +1,4 @@ function equalsTen(num) { // your code here - + return num == 10 } diff --git a/exercises/014-isLessThan/app.js b/exercises/014-isLessThan/app.js index d7572d4ad..6fac9d5c0 100644 --- a/exercises/014-isLessThan/app.js +++ b/exercises/014-isLessThan/app.js @@ -1,3 +1,4 @@ function isLessThan(num1, num2) { // your code here + return num2 < num1 } diff --git a/exercises/015-isGreaterThan/app.js b/exercises/015-isGreaterThan/app.js index 83c54fd95..8e2a582c7 100644 --- a/exercises/015-isGreaterThan/app.js +++ b/exercises/015-isGreaterThan/app.js @@ -1,4 +1,4 @@ function isGreaterThan(num1, num2) { // your code here - + return num2 > num1 } diff --git a/exercises/016-isEqualTo/app.js b/exercises/016-isEqualTo/app.js index 6ebc804ae..7f5b858a6 100644 --- a/exercises/016-isEqualTo/app.js +++ b/exercises/016-isEqualTo/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function isEqualTo (num1,num2) { +return num1 === num2 +} \ No newline at end of file diff --git a/exercises/017-isEven/app.js b/exercises/017-isEven/app.js index 6ebc804ae..61ed93566 100644 --- a/exercises/017-isEven/app.js +++ b/exercises/017-isEven/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function isEven (num) { + return num % 2 === 0 +} \ No newline at end of file diff --git a/exercises/018-isOdd/app.js b/exercises/018-isOdd/app.js index 6ebc804ae..930974390 100644 --- a/exercises/018-isOdd/app.js +++ b/exercises/018-isOdd/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function isOdd (num) { + return num % 2 != 0 +} \ No newline at end of file diff --git a/exercises/019-areBothOdd/app.js b/exercises/019-areBothOdd/app.js index 3e2df3368..a09418e6f 100644 --- a/exercises/019-areBothOdd/app.js +++ b/exercises/019-areBothOdd/app.js @@ -1 +1,4 @@ // Write your function here +function areBothOdd (num1,num2) { +return num1 % 2 != 0 && num2 % 2 != 0; +} \ No newline at end of file diff --git a/exercises/020-isEitherEven/app.js b/exercises/020-isEitherEven/app.js index 6ebc804ae..46aabe21c 100644 --- a/exercises/020-isEitherEven/app.js +++ b/exercises/020-isEitherEven/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function isEitherEven (num1, num2) { +return num1 % 2 == 0 || num2 % 2 == 0; +} \ No newline at end of file diff --git a/exercises/021-isOddLength/app.js b/exercises/021-isOddLength/app.js index 3e2df3368..ca49a01d0 100644 --- a/exercises/021-isOddLength/app.js +++ b/exercises/021-isOddLength/app.js @@ -1 +1,4 @@ // Write your function here +function isOddLength (word) { + return word.length % 2 != 0 +} \ No newline at end of file diff --git a/exercises/022-isEvenLength/app.js b/exercises/022-isEvenLength/app.js index 6ebc804ae..4c52fc20a 100644 --- a/exercises/022-isEvenLength/app.js +++ b/exercises/022-isEvenLength/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function isEvenLength (word) { +return word.length % 2 == 0 +} \ No newline at end of file diff --git a/exercises/023-computeAverageLengthOfWords/app.js b/exercises/023-computeAverageLengthOfWords/app.js index 6ebc804ae..3d9de6e98 100644 --- a/exercises/023-computeAverageLengthOfWords/app.js +++ b/exercises/023-computeAverageLengthOfWords/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function computeAverageLengthOfWords(word1, word2) { + return (word1.length + word2.length) / 2 +} \ No newline at end of file diff --git a/exercises/024-isEvenAndGreaterThanTen/app.js b/exercises/024-isEvenAndGreaterThanTen/app.js index 6ebc804ae..9e3160c7e 100644 --- a/exercises/024-isEvenAndGreaterThanTen/app.js +++ b/exercises/024-isEvenAndGreaterThanTen/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function isEvenAndGreaterThanTen(num) { + return num % 2 == 0 && num > 10 +} \ No newline at end of file diff --git a/exercises/025-average/app.js b/exercises/025-average/app.js index 6ebc804ae..6742e2327 100644 --- a/exercises/025-average/app.js +++ b/exercises/025-average/app.js @@ -1 +1,4 @@ -// Write your function here \ No newline at end of file +// Write your function here +function average (num1,num2) { + return (num1 + num2) /2 +} \ No newline at end of file diff --git a/exercises/026-computeAreaOfATriangle/app.js b/exercises/026-computeAreaOfATriangle/app.js index 3e2df3368..1793db907 100644 --- a/exercises/026-computeAreaOfATriangle/app.js +++ b/exercises/026-computeAreaOfATriangle/app.js @@ -1 +1,4 @@ // Write your function here +function computeAreaOfATriangle () { + +} \ No newline at end of file