feat(07): finished

This commit is contained in:
Matheus Brollo Dauter 2022-10-31 14:55:36 -03:00
parent 67b64bc155
commit 6246ae3c5a
3 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,6 @@
export function isPrime(value) {
// implementar logica aqui
for (var divisão = 2; divisão < value; divisão++)
for (let divisão = 2; divisão < value; divisão++)
if (value % divisão == 0) return false;
return true;
}

View File

@ -1,9 +1,9 @@
export function sum(values) {
// implementar logica aqui
var total = 0;
for(var i = 0; i < values.length;i++)
let total = 0;
for(let i = 0; i < values.length;i++)
{
total += Number(values[i]);
total += values[i];
}
return total;
}

View File

@ -1,4 +1,16 @@
export function sumEven(value) {
// implementar logica aqui
let total = 0
let even = []
for (let i = 0; i < value.length; i++) {
if (value[i] % 2 == 0) {
even.push(value[i])
}
}
for (let i = 0; i < even.length; i++)
{
total += even[i];
}
return total;
}