← BYTES
JavaScript·Intermediate·Ref: 3.2.11

What does `Array.prototype.find()` return when no element satisfies the predicate?

Have a question about this video? Mention reference 3.2.11 when you contact us.

a.undefined
b.null
c.An empty array
d.Throws an error
`find()` returns the first matching element, or `undefined` if nothing matches -- note this is different from `indexOf`-style methods, which typically return -1 on no match instead of undefined.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES3211#JavaScript