remove duplicate strings that are case insensitive
How can i make this script case insensitve (e.g. at the moment i get 'damon' and 'Damon'. Say i just want to keep the lowercase 'damon'?)?
var unique = function(origArr) {
var newArr = [],
origLen = origArr.length,
found,
x, y;
for ( x = 0; x < origLen; x++ ) {
found = undefined;
for ( y = 0; y < newArr.length; y++ ) {
if ( origArr[x] === newArr[y] ) {
found = true;
break;
}
}
if ( !found) newArr.push( origArr[x] );
}
return newArr;
}
Bookmarks