var src = [
{name: 'Vasya'},
{name: 'Zina'},
{name: 'Vasya'},
{name: 'Vasya'},
{name: 'Petya'},
{name: 'Vasya'},
{name: 'Petya'},
{name: 'Vasya'},
];
var temp = {};
var result = [];
src.forEach(function(item) {
var name = item.name;
if (!temp[name]) {
temp[name] = true;
result.push(item);
}
});
console.log(result);
// TOOLTIP PLUGIN DEFINITION
// =========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
if (!data && /destroy|hide/.test(option)) return
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.tooltip
$.fn.tooltip = Plugin
$.fn.tooltip.Constructor = Tooltip