How to Remove Specific Value from Array in JQuery?

By Hardik Savani November 5, 2023 Category : Javascript jQuery

Hi Developer,

I am going to show you an example of remove specific value from array javascript. I explained simply about remove particular value from array javascript. I explained simply step by step js remove specific element from array. I explained simply about javascript delete specific value from array.

When I was working on my code PHP project, at that time I need to remove specific items value from my javascript array. i did a google search and solve that but I would like to share on my site how to remove value from the javascript array. so, let's see how to use:

Example:

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title></title>

</head>

<body>

<script type="text/javascript">

var languages = ['php', 'laravel', '.net', 'java', 'c#', 'javascript']

var deleteLanguage = 'laravel';

languages = jQuery.grep(languages, function(value) {

return value != deleteLanguage;

});

console.log(languages);

</script>

</body>

</html>

Output:

['php', '.net', 'java', 'c#', 'javascript']

I hope it can help you...

Shares