0
myArr = [{"name":"abc"},{"name":"efg"},{"name":"abc"}]

How to eliminated array that have redundant property value?

tony yew
  • 51
  • 5

1 Answers1

0

If you can use Underscore then here is inbuild function _.uniq

var myArr = [{"name":"abc"},{"name":"efg"},{"name":"abc"}];
var newArr = _.uniq(myArr, 'name');

Output:

[{"name":"abc"},{"name":"efg"}]

DEMO

Manwal
  • 23,450
  • 12
  • 63
  • 93