get_bid() {
let higest_bid_array:any[];
for(let i=0; i < this.crypto.length;i++) {
higest_bid_array = this.crypto[i].highestBid;
}
return higest_bid_array;
}
I've declared the variable as an array.
higest_bid_array:any[];
Here crypto
is an array with values for example: crypto[i].highestBid
has the value [1234, 5647, 8500];
How do i assign the values of crypto
to higest_bid_array
;
higest_bid_array should return
[1234, 5647, 8500]
, it now returns only 8500 i,e. the last value of that array.
where am i going wrong ? thanks.