Remove array values

To remove values from array in js use _.reject on array. From array ‘categoryArray’ remove values equal to variable ‘hideCategory’.
var categoryArray = originalRet.categories[1].categories;
categoryArray= _.reject(categoryArray, function (method) { return method.text==hideCategory; });

Leave a comment

Your email address will not be published. Required fields are marked *