Created
August 11, 2019 08:11
-
-
Save cosminpopescu14/a5a00f648a7c0d07a65ddd3b27493a9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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