JQuery - How To Remove Duplicate Value From Array?

Jquery

Nicesnippets

188

02-04-2021


JQuery - How To Remove Duplicate Value From Array?

Hi Guys,

In this blog, I will learn you how to remove duplicate value from array using jquery. We will talk about jquery remove duplicate value from array. This tutorial will give you how to remove duplicate value from array in jquery.

Actually, very few months ago i need to work with jquery array. i have multiple time duplicate value in javascript array. i don't require to display then again and again, i just want to remove that same value in jquery. i had found out the solution of remove duplicates value from array in jquery.

Here i will give you full example for how to remove duplicate value from array using jquery. So let's see the bellow example:

Example :


<!DOCTYPE html>

<html lang="en">

<head>

<title>How to remove duplicate value from array in Jquery? - NiceSnippets.com</title>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

</head>

<body>

<script>

var my_Array = ["Mahesh","Jayesh","Ramesh","Jayesh","Suresh","Mahesh"];

var NewArray = my_Array.filter(function(element,index,self){

return index === self.indexOf(element);

});

console.log(NewArray);

</script>

</body>

</html>

It will help you....


Recommended Posts