Jquery Remove Multiple Values from Array Example

Jquery Remove Multiple Values from Array Example

In this post we will give you information about Jquery Remove Multiple Values from Array Example. Hear we will give you detail about Jquery Remove Multiple Values from Array ExampleAnd how to use it also give you demo for it if it is necessary.

in this post, i would like to give you example of how to remove multiple element from array in jquery. we can simply remove multiple values from array in jquery. you can see simple example of remove multiple items from array in jquery.

we will use Array.prototype.remove, grep() and inArray() for removing multiple values from array in jquery. you can just see bellow example it’s done. you can easily use with your jquery array.

If you want to remove single item from jquery array by value then you can follow this tutorial: How to Remove Array Element in Jquery by Value?.

So let’s see bellow simple example of jquery remove multiple values from array.

Example :

<!DOCTYPE html>

<html>

<head>

<title>Jquery Remove Multiple Values from Array Example - ItSolutionStuff.com</title>

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>

</head>

<body>

<script type="text/javascript">

var sites = [ "ItSolutionStuff.com", "HDTuto.com", "NiceSnippets.com", "Hackthestuff.com" ];

Array.prototype.remove = function(){

var args = Array.apply(null, arguments);

return $.grep(this, function(value) {

return $.inArray(value, args) < 0;

});

}

sitesNew = sites.remove("HDTuto.com", "NiceSnippets.com");

console.log(sitesNew);

</script>

</body>

</html>

Output:

Also see:How to Remove Array Element in Jquery by Value?

["ItSolutionStuff.com", "Hackthestuff.com"]

I hope it can help you…

Hope this code and post will helped you for implement Jquery Remove Multiple Values from Array Example. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

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

  +  68  =  70

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US