main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let _ = require('lodash');

let results = [{
                    "id": 1,
                    "name": "Yoga",
                    "code": "YOGA",
                },
                {
                    "id": 2,
                    "name": "Yoga",
                    "code": "YOGA",
                },
                {
                    "id": 3,
                    "name": "Zumba",
                    "code": "ZUMBA",
                },]

let filterResults = _.uniqBy(results, 'code')
console.log(filterResults)

Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie