Created
April 11, 2020 03:49
-
-
Save riffrain/14cbd31280d11b5bdbb9b6d69995ad26 to your computer and use it in GitHub Desktop.
array2object object2array
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
function array2object(arr) { | |
return { ...arr }; | |
} |
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
function object2array(obj) { | |
return Object.keys(obj).map((key) => obj[key]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment