var array = [1,1,1,2,3,4,4,5];
var models = [];
for ( var i = 0; i < array.length; i++ ) {
if ( array.indexOf( array[ i ] ) === i ) {
models.push(array[ i ] );
}
}
var encontrados = {};
for (var i = 0; i < array.length; i++) {
if (encontrados[array[i]] === undefined){
encontrados[array[i]] = true;
models.push(array[i]);
}
}
models = Array.from(new Set(array));
models = [... new Set(array)];