-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e62cc84
commit c6bfa70
Showing
2 changed files
with
40 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
export function verificarParOuImpar(numero){ | ||
if(typeof numero != "number" ){ | ||
return null // o tipo precisa ser entre aspas | ||
} | ||
if(numero % 2 === 0){ | ||
return `Par` | ||
export function verificarParOuImpar(numero) { | ||
if (typeof numero != "number") { | ||
return null; // o tipo precisa ser entre aspas | ||
} | ||
if (numero % 2 === 0) { | ||
return `Par`; | ||
} else { | ||
return `Ímpar`; | ||
} | ||
} | ||
export function maiorNumero(lista) { | ||
// utiliza Array.isArray para verificar se uma variavél é uma lista | ||
if (!Array.isArray(lista) || lista.length === 0) { | ||
return null; | ||
} | ||
return Math.max(...lista); | ||
} | ||
|
||
export function atualizarPropriedade(objeto,propriedade,valor){ // in é como se estivesse dentro | ||
|
||
} else{ | ||
return `Ímpar` | ||
} } | ||
export function maiorNumero(lista){ // utiliza Array.isArray para verificar se uma variavél é uma lista | ||
if(!Array.isArray(lista) || lista.length === 0 ){ | ||
return null; | ||
} | ||
return Math.max (... lista); | ||
} | ||
|
||
|
||
|
||
|
||
// export function atualizarPropriedade(objeto,propriedade,valor){ | ||
|
||
// if(propriedade in objeto){ | ||
// objeto[propriedade] = valor | ||
// } | ||
// } | ||
if(propriedade in objeto){ | ||
objeto[propriedade] = valor | ||
return objeto | ||
}return null | ||
} | ||
|
||
export function contarCaracter () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters