- 2
JavaScript
Fill in the blanks to declare an arrow function that takes an array and prints the odd elements. const printOdds = (arr)__{ __.forEach( __ => { if (el % 2 != 0) console.log(el); }); }
5 odpowiedzi
+ 5
omkar bawankar
:
arr
el
but go through course again.
+ 2
If you don't have any question than please don't ask us to do what needs to be done by you ,if you didn't understand you can go through the course again
0
I need answer
0
const printOdds = (arr) => {
arr.forEach((el) => {
if (el % 2 != 0) console.log(el);
});
}
// or:
const printOdds = arr => {
arr.forEach(el => {
if (el % 2 != 0) console.log(el);
});
}
/*
* because round brackets are not required, if any argument.
* This is wrong:
* const a = => 5
*/
0
=>
arr
el
This is very correct!