Linked Questions

2918 votes
94 answers
3.7m views

I have an array of numbers that I need to make sure are unique. I found the code snippet below on the Internet, and it works great until the array has a zero in it. I found this other script here on ...
Mottie's user avatar
  • 86.7k
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
8 votes
3 answers
12k views

I am using Mongoose in a MEAN environment. How can I make sure to not have any duplicate results in my result set? Example: my database contains 10 (partly duplicate) names: Allan Allan Fourier Allan ...
Igor P.'s user avatar
  • 1,497
4 votes
4 answers
6k views

I am new to typescript, and i've been having some problems in using my javascript skills. For example, can someone help me to write this exactly same javascript code below in typescript? If not ...
Nando's user avatar
  • 113
0 votes
2 answers
4k views

In TypeScript I want distinct values from comma separated duplicate string: this.Proid = this.ProductIdList.map(function (e) { return e.ProductId;}).join(','); this.Proid = "2,5,2,3,3"; And I need : ...
mangesh's user avatar
  • 365
2 votes
6 answers
4k views

I am using this code to read all the values from each object with the key "category": const listChapter = datas.map((data) => console.log(data.category)) datas is an array of Objects, and there ...
Pierre Trzaska's user avatar
2 votes
3 answers
1k views

export interface IGUser { biography: string; id: string; ig_id: string; followers_count: number; follows_count: number; media_count: number; name: string; profile_picture_url: string; ...
Jonathan Jeshua Laniba's user avatar
0 votes
1 answer
1k views

I am trying to find duplicate objects from array by camparing more than 1 field inside object. I want to compare 2 fields of the object with the other objects of the same array. I want to campare ...
Manpreet Oberoi's user avatar
0 votes
4 answers
419 views

I have put a general title for a good search, but my question is a bit more specific. I have got one array: var keywords= ["Anglo-Saxon English","American English","British English","Canadian ...
Kanan Farzali's user avatar
1 vote
3 answers
598 views

I'd need your help... I'm sorry if the question has already been asked but I can't seem to find a suitable answer for my problem: I'm trying to extract (not remove) the list of the duplicates from my ...
Martin Carre's user avatar
  • 1,259
-1 votes
3 answers
173 views

I hava a json object as var arr=[{"id":"1","ref":"100"},{"id":"2","ref":"200"},{"id":"3","ref":"100"}] Now I have a function such that a new json object is passed ex.{"id":"4","ref":"400"},then I ...
user7350714's user avatar
-1 votes
2 answers
176 views

I would like to create a drop-down list and retrieve the elements from a webService. My problem is that I would like to avoid displaying duplicate items because I have 9999 items. Here is the JSON ...
mercyto's user avatar
  • 41