forked from caroline_moran/algoritmos-para-estudar
Compare commits
No commits in common. "4606996e2c57d4e6b7904eba35f9026526041720" and "d065868ff08fd6c786d2b1451696ec1fa7a0f4f1" have entirely different histories.
4606996e2c
...
d065868ff0
14
Aula1.html
14
Aula1.html
@ -66,14 +66,20 @@
|
||||
// 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);
|
||||
return pares5;
|
||||
console.log(numbers);
|
||||
const pares5 = []
|
||||
numbers.forEach(element => {
|
||||
if (element % 2 === 0 ) {
|
||||
if (element % 5 === 0) {
|
||||
pares5.push(element)
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(pares5);
|
||||
}
|
||||
paresPor5();
|
||||
</script>
|
||||
|
14
Aula2.html
14
Aula2.html
@ -57,14 +57,20 @@
|
||||
// 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);
|
||||
return pares5;
|
||||
console.log(numbers);
|
||||
const pares5 = []
|
||||
numbers.forEach(element => {
|
||||
if (element % 2 === 0 ) {
|
||||
if (element % 5 === 0) {
|
||||
pares5.push(element)
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(pares5);
|
||||
}
|
||||
paresPor5();
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user