No entendí bien, pero vamos a ver:
Código Javascript
:
Ver originalvar list = ['Perro', 'Perro', 'Gato', 'perrito', 'gatito', 'gatito'];
var anotherList = list
.reduce(function(memo, current) {
if(memo.indexOf(current) === -1) {
memo.push(current);
}
return memo;
}, [])
.sort(function(one, another) {
return one.toLowerCase() >
another.toLowerCase() ?
1 : -1;
});
anotherList; // ["gatito", "Gato", "perrito", "Perro"]
PD: Hacer eso que hice en PHP es mucho más díficil.