Retrieve unique child objects from an array
Here's a more functional solution, which based on your example is what you're looking for.  It relies on the uniqueness of object keys.  Note it's untested, but the idea should work:

function getMasters() {
  var extended = r =&gt; new ExtendedRank(r.master.id r.master.code, r.master.name),
  return Object.values(
    this.ranks.reduce((m,r) =&gt; Object.assign(m, {[r.master.id]: extended(r)}), {});
  ).sort(this.sort);
}


If you're looking to go even further in this direction, I recommend checking out ramda as a better, more functional alternative to underscore.