Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let _ = require('underscore');
let data = [ { Data: 2019, IdJudet: "09,18" }, { Data: 2019, IdJudet: "09,18, 20, 03" }, { Data: 2019, IdJudet: "09" }, { Data: 2019, IdJudet: null } ]
let collectedData = _.collect(data)
let counties = _.pluck(collectedData, 'IdJudet').join(',').replace(/\s+/g, '')
let noDupesCounties = _.uniq(counties.split(',').filter(Boolean))
console.log(noDupesCounties)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.