w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to remove Multiple elements from an Array by name

You just need to iterate the itemsToRemove -

var mularr
= ["jQuery","JavaScript","HTML","Ajax","Css"];
var itemstoRemove = ["jQuery","HTML"];
for(var i=0;i<itemstoRemove.length;i++)
   mularr.splice($.inArray(itemstoRemove[i], mularr),1); // note the [i]

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.