Compare commits

..

No commits in common. "4606996e2c57d4e6b7904eba35f9026526041720" and "d065868ff08fd6c786d2b1451696ec1fa7a0f4f1" have entirely different histories.

2 changed files with 20 additions and 8 deletions

View File

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

View File

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