How to remove specifc value from array using jQuery

Step1: Create an array
Step2: Use the grep() method of jQuery, which takes  parameters.
            First parameter is array.


var x = [9, 10, 11,12,13,14,15]
var removeData = 12;

x = jQuery.grep(x, function(value) {
 return value != removeData;
     });

-----------------------------
Output:-
[9, 10, 11,13,14,15]
Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment