we are in the year 2022!!
const greaterThanThree = num => num > 3
To be fair (despite the formatting), it does say "for beginners", and the prevailing thought is still that beginners don't like arrow functions.
That said, if we want to do this, might as well do it right:
const greaterThan = than => num => num > than; const greaterThanThree = greaterThan(3);
Well then I'd rather do it that way
const isGreaterThan = num => value => value > num let list = [1,2,3,4,5] console.log( list.filter(isGreaterThan(3)) )
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
we are in the year 2022!!
To be fair (despite the formatting), it does say "for beginners", and the prevailing thought is still that beginners don't like arrow functions.
That said, if we want to do this, might as well do it right:
Well then I'd rather do it that way