Skip to content

Instantly share code, notes, and snippets.

@rodriguezartav
Created July 10, 2014 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodriguezartav/8ee0913c2a81f859df5f to your computer and use it in GitHub Desktop.
Save rodriguezartav/8ee0913c2a81f859df5f to your computer and use it in GitHub Desktop.
Get unique attributes from data items
var productos = Producto.all();
var marcas = [];
for (var i = productos.length - 1; i >= 0; i--) {
var marca = productos[i].marca;
if(marcas.indexOf(marca) == -1 ) marcas.push(marca);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment