I'm trying to populate an unordered list using the LastNames from my viewModel.Names. It populates fine but I only want distinct values and this is currently giving multiple of the same LastName? How can I get the distinct values?
Update: there is a FirstName MiddleName LastName
View Model:
<ul data-bind="foreach: viewModel.Names">
<li><a data-bind="text: LastName"></a></li>
</ul>
Update: I can get the distinct values with the following function, I cannot data-bind the text though. Here is a screenshot of my console.log of my array of cities which is in the same situation as LastName.

this.LastNames = ko.dependentObservable(function () {
var data = ko.utils.arrayMap(viewModel.Names(), function (item) {
return item.LastName()
})
return ko.utils.arrayGetDistinctValues(data).sort();
});
Here is my new View Model:
<uldata-bind="foreach: LastNames">
<li><input type="checkbox"/><a data-bind="text: []"></a></li>
</ul>