0 votes
in JQuery by
Difference between Map and Grep function in jQuery?

1 Answer

0 votes
by

Map function translates a set of elements into another set of values in a jQuery array that may or may not have the elements. The map is called:

$(“<element>”).map(<function to execute for elements in the object>)

Grep, on the other hand, finds an element in an array.

jQuery.grep(myArr, function(){}

...