Another cool thing you could do to expand on this would be to break the function out into something reusable like this:
const isOfAge = person => person.age >= 21
That way the code becomes more resusable and more readable.
Awesome! Thanks, Joel.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.