JSFiddle - React, Tailwind, and code Playground

by Pachito Marco Calabrese

JavaScript

var texture1 = "something1";
var texture2 = "something2";
var texture3 = "something3";

var meshes = [
    {name: "Mesh 0", texture: texture1},
    {name: "Mesh 1", texture: texture2},
    {name: "Mesh 2", texture: texture3},
    {name: "Mesh 3", texture: texture3},
    {name: "Mesh 4", texture: texture2},
    {name: "Mesh 5", texture: texture1},
    {name: "Mesh 6", texture: texture1},
    {name: "Mesh 7", texture: texture2},
    {name: "Mesh 8", texture: texture3},
    {name: "Mesh 9", texture: texture1}
];

console.log(_(meshes).pluck('texture'));
sorted = _(meshes).sortBy(function(meshes) {
    return meshes.texture;
});

console.log(sorted);