Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49225

How to remove duplicate value from an array

$
0
0

@flycoders_sourav wrote:

actually i want to checking at the time of pushing the value into the array. If duplicate then the value will not push.how can i do that.

public selectcity:any=[];
public test: any = [];
i want to push the whole value into the test array. when pushing the value from selectcity array at the time. i want to check If duplicate then the value will not push.how can i do that.

below my array push code:

  for(let i =0;i<this.selectcity.length;i++){

            this.test.push(this.selectcity[i]);
  }

please help me any one

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49225

Trending Articles