develop/exercicios #3

Merged
Gabriel_Ferraz_Nogueira merged 2 commits from develop/exercicios into main 2022-11-04 18:01:57 +00:00
Showing only changes of commit f16746faa4 - Show all commits

View File

@ -57,20 +57,14 @@
// return par / 5
function paresPor5() {
const numbers = [];
const pares5 = []
for (let i = 0; i < 40; i++) {
let numb = Math.floor(Math.random() * 100)
if (numb % 2 === 0 && numb % 5 === 0) {pares5.push(numb)}
numbers.push(numb);
};
console.log(numbers);
const pares5 = []
numbers.forEach(element => {
if (element % 2 === 0 ) {
if (element % 5 === 0) {
pares5.push(element)
}
}
});
console.log(pares5);
//console.log(numbers);
return pares5;
}
paresPor5();
</script>