-1
I wonder if there is any way to select information that repeats many times. Example: I have an object array:
array = [{fruta: maçã}, {fruta: maçã}, {fruta: banana}]
Note that the apple fruit repeats twice and the banana only 1.
I needed a variable to receive the 'Apple' because it is the one that appears most.
I’m doing like this:
this.variavel = array[0].fruta
but this way I’m only getting the first and not the one that appears more.
Any suggestions?