+ 2
How do I change this arrow function to normal funcion 🙆
const printOdds = (arr) => { arr.forEach (el=>{ if (el % 2 != 0) console.log (el); }); }
6 Antworten
+ 5
Why you wanted to do this?
function printOdds(arr)
{
arr.forEach (function(el)
{
if (el % 2)
console.log (el);
});
}
a = [10, 23,30,47, 50];
printOdds(a);
+ 3
Oh yea thought it a bug at first😃
+ 2
Thanks Ipang 👍
Been writing codes with an older machine.
+ 2
Please note forEach won’t work on older version for defined browser. https://caniuse.com/#search=forEach
+ 1
I was told these new standards works if we use updated browser, does it work for you, updated browser?
0
eodejdijeijed