- 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);   }); }

13th May 2020, 10:43 AM
omkar bawankar
omkar bawankar - avatar
5 odpowiedzi
+ 5
omkar bawankar : arr el but go through course again.
13th May 2020, 10:44 AM
A͢J
A͢J - avatar
+ 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
13th May 2020, 10:44 AM
Abhay
Abhay - avatar
0
I need answer
13th May 2020, 10:47 AM
omkar bawankar
omkar bawankar - avatar
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 */
13th May 2020, 12:27 PM
Tomáš Wróbel
Tomáš Wróbel - avatar
0
=> arr el This is very correct!
27th Oct 2020, 4:05 PM
Bukola Adebisi
Bukola Adebisi - avatar