Linked Questions

6 votes
5 answers
4k views

Before people think this is the same as all these other answers on Stack Overflow regarding removing duplicates can you please look at what is returned as opposed to what I am looking to do. I want ...
peter flanagan's user avatar
4 votes
1 answer
3k views

I have a question in Javascript. This is the following Array: [1,0,0,0,0,0,0] I would like to return the only value that does not repeat, that is, 1. Any suggestions? I have this: var result = ...
Marcio's user avatar
  • 1,733
-2 votes
1 answer
670 views

let getNonDuplicates = [1,2,3,4,2,3,4,5]; // Here's my example array the result I needed is to get 1 & 5 since those are the data that don't have duplicates let resultMustBe = [1,5];
Gerard Mendiola's user avatar
0 votes
1 answer
1k views

i wanna find Non-duplicate element array in javascript with filter method. for example: const number = [1,2,1,3,4,5,3]; i wanna find 2,4,5 in array please help me
Ali sh's user avatar
  • 3
-1 votes
3 answers
202 views

I am trying to exclude duplicate numbers from the array. For example: if I filter an array of [1,2,2,3,5,5] the output should be [1,3]. function unique(arr) { let sortArr = arr.sort() let res = [] ...
JohnPix's user avatar
  • 1,863
1 vote
3 answers
80 views

I have array like below myArray = ["foo", "bar", "foo", "bar", "bar", "bar", "zoom"] I want output like this nameArray = ["foo", "bar", "zoom"] and qtyArray = [2, 4, 1] I will be using Plotly out ...
snaseer's user avatar
  • 13
1 vote
3 answers
117 views

for example if arr = [1,1,2,3,5,5] this will return [1,2,3,5]. function returnUnique(arr) { let unique = [...new Set(arr)]; return unique; }; my goal is to return only 2,3
che2programmer's user avatar
0 votes
3 answers
64 views

In this case I have 3 arrays in javascript: var array1 = ['124','10','100','190','1000']; var array2 = ['124','100','190', '45']; var array3 = ['124','100','175','19','1900']; I need a script that ...
user avatar
-4 votes
1 answer
66 views

var arr = [1, 1, 1, 5, 3, 4, 6, 6] function uniqueRetriever(bla, boi) { ... } var unique = uniqueRetriever(bla, boi) console.log(unique); //output: [5, 3, 4] How do I retrieve unique elements from ...
Dilawar Mahmood's user avatar
0 votes
1 answer
63 views

I have an array of objects with input like below var jsonArray1 = [{id:'1',name:'John'},{id:'2',name:'Smith'},{id:'3',name:'Adam'},{id:'1',name:'John'}] The id 1 appears twice and I would like to ...
Sadiq Sikkandhar's user avatar
1 vote
0 answers
51 views

Ho do I remove same values in an array has? example code: const array = [10, 20, 30, 40, 20, 70, 10 ] Expected output: const outputArray = [30, 40, 70]; I can remove the duplicate value. But how to ...
imjayabal's user avatar
  • 831
0 votes
0 answers
33 views

We have a array of numbers. let's say const num = [ 10, 12, 4, 3, 5, 5, 10, 12 ]; Element with no duplicate is 4 and 3 in the 'num' array. So function should return array such elements. It would be ...
Alish Madhukar's user avatar
2538 votes
51 answers
3.4m views

I have a very simple JavaScript array that may or may not contain duplicates. var names = ["Mike","Matt","Nancy","Adam","Jenny","Nancy",&...
kramden88's user avatar
  • 25.7k