Iterating and Modifying Array Entries with jQuery.map - J Query

Problem
You need to loop over each element in an array and modify its value.

Solution

Discussion
In this recipe, $.map() is iterating over the months array and returns the abbreviation (first three characters). The $.map() method takes an array and a callback method as arguments and iterates over each array element executing the callback as defined by the developer. The array entry will be updated with the return value of the callback.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

J Query Topics