Many ways, but uniq() not a method in an array, it is a lodash method.
_.uniq(_.map(data, 'usernames'))
Or:
_.chain(data).map('usernames').uniq().value()
(The second is untested and possibly incorrect, but it closes.)
As mentioned in the commentary, depending on your data, in fact, you can do this with just one shot without pulling all usernames out of it.
source share