bugfix: declara i e transforma string em booleano

This commit is contained in:
Vinicius 2022-11-08 18:34:51 -02:00
parent 97e2b39b67
commit 3c9a57e29d
3 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,7 @@
export function fibonacci(value) {
// implementar logica aqui
let f = [];
let n = 2;
f[0] = 0;
f[1] = 1;
for (n = 2; n <= value; n++) {

View File

@ -18,8 +18,8 @@ export function isPrime(value) {
value % 7 != 0 &&
value % 11 != 0 &&
value % 13 != 0
? "true"
: "false";
? true
: false;
}
return primo;
}

View File

@ -3,15 +3,16 @@ export function isAnagram(word1, word2) {
let par_1 = word1.toLowerCase().split("").sort();
let par_2 = word2.toLowerCase().split("").sort();
let final;
let i = 0;
if (par_1.length != par_2.length) {
final = "false";
final = false;
} else {
for (i in par_1) {
if (par_1[i] != par_2[i]) {
final = "false";
final = false;
break;
} else {
final = "true";
final = true;
}
}
}