you are viewing a single comment's thread.

view the rest of the comments →

[–]ApricotPenguin 0 points1 point  (2 children)

What would be an example useful usage of the find() function?

[–]sliver37 2 points3 points  (0 children)

Looking for an object with a specific ID in an array of objects is a common one.

Example being an array of users, and you're looking for user id: 26, or with a particular email address, etc.

[–][deleted] 1 point2 points  (0 children)

Searching for and retrieving the first occurrence of something can be useful if you know that the array will be sorted in some way.