Created
May 16, 2018 19:30
-
-
Save BrunoDSouza/f31bfc710e4d4bc0bf067462ca81517b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function WriteCritica(dados, columns) { | |
const arrObj = [] | |
for(row of dados) { | |
let obj = {} | |
for (prop in row) { | |
for(col of columns) { | |
if (prop == col) obj[prop] = row[prop] | |
} | |
} | |
if (!obj.isEmpty()) arrObj.push(obj) | |
} | |
return arrObj | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment