JavaScript some() method
Did you ever need to know if one of the elements in an array passed a test?
This is where the some() method comes in handy.
Let's keep using our product array, but let's add a discounted product.
We then want to test if some of our products are disco...
h.daily-dev-tips.com3 min read
Daniel Augusto De Abreu Mascena
Frontend Developer @Dataprev e-gov br
Thanks for sharing but your last example returns an incorrect result:
users[2/*Billy*/].age < 18 // returns false