Join WhatsApp ChannelJoin Now

Unique Values Get In Jquery array

Today, i we will show you unique values get in jquery array. This article will give you simple example of unique values get in jquery array. you will learn unique values get in jquery array. So let’s follow few step to create example of unique values get in jquery array.

Preview:
Unique Values Get In Jquery array

Example

<!DOCTYPE html>
<html>
<head>
   <title>Unique Values Get In Jquery array</title>
   <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
</head>
<body>
  
<script type="text/javascript">
    var sites = ["mohan","rakesh","krishan","mohan"];
  
    var uniqueSites = sites.filter(function(item, i, sites) {
        return i == sites.indexOf(item);
    });
  
    console.log(uniqueSites);
</script>
  
</body>
</html>

Recommended Posts