6
I wanted some function that returned TRUE when all values within an array were equal or if all were different, and returned FALSE if they were not all the same and not all different. In case you don’t understand, I’ll explain with examples:
Ex:
If I have the following(s) array(s) for verification:
var arr = ['xx','xx','xx']; //(todos iguais)
//ou
var arr = ['xx','yy','zz']; //(todos diferentes)
The function would return TRUE, but if it were an array in which the values are not all equal not all different it would return FALSE, as in the following situation:
var arr = ['xx','xx','zz']; //(Os valores não todos iguais, e nem todos diferentes)
Eai? Does anyone have any idea how I can do this?
What have you tried?
– user3603