diff --git a/01-greeting/index.js b/01-greeting/index.js index 5c0279c..8f551af 100644 --- a/01-greeting/index.js +++ b/01-greeting/index.js @@ -1,4 +1,4 @@ export function greet(name) { // implementar logica aqui - return `Hello ${name}`; + return ""; } diff --git a/02-triangleArea/index.js b/02-triangleArea/index.js index ba46510..af87c31 100644 --- a/02-triangleArea/index.js +++ b/02-triangleArea/index.js @@ -1,4 +1,5 @@ export function triangleArea(base, height) { // your code here - return "" + + return base * height /2; } \ No newline at end of file diff --git a/10-longestWords/index.js b/10-longestWords/index.js index 34feeed..4b7b9f6 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,27 @@ export function longestWords(words) { - // implementar logica aqui - return "" -} \ No newline at end of file + // implementar logica aqui + + const lengthArray = [] + + words.forEach(element => { + lengthArray.push([element, element.length]) + }) + + let res = ['', 0] + + lengthArray.forEach(array => { + if (res[1] < array[1]) { + res = array + } + }) + + const AllLongestWords = [] + + lengthArray.forEach(array => { + if (res[1] == array[1]) { + AllLongestWords.push(array[0]) + } + }) + + return AllLongestWords +}