I have array that i get from service, and in that array I have elements that are same (example: 1,2,2,3,1,1,3). I want to make another array that will contain only one of each elements from previous array (so new array should look like [1,2,3 etc). Can you point me to error in this function. Thanks
this.dataService.get().subscribe( response => {
this.Data = response;
response.forEach(res => {
for (this.i = 0; this.i < this.headData.length; this.i++){
res.head !== this.headData[this.i];
}
this.headData.push(res.head);
}) }