Is using .find()
in JavaScript inefficient as compared to using .map()
or .forEach()
?
For example, in case of an array of objects :
var arr=[{name:"vishek",ID:222,subjects:["science","maths","politics"]}]
For such an array, is it efficient to use .find
to find a particular object or .map()
?