Created
October 19, 2017 04:13
-
-
Save hwindo/48c79f86bd379a2d474bb10de8cec739 to your computer and use it in GitHub Desktop.
change object to arr using underscore
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
const toArr = function (objData) { | |
var arr = []; | |
_.map(objData, function (val, key) { | |
val.id = key; | |
arr.push(val); | |
}); | |
return arr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment