Last active
February 8, 2017 15:50
-
-
Save antonybudianto/959c3446328e5c8266ce078646dac7b1 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 jsonToFirebaseJSON(arr) { | |
const result = arr.reduce((acummulator, current, index) => | |
(Object.assign({}, acummulator, {[index]: current})), {}); | |
return JSON.stringify(result); | |
} | |
// index can be replaced with your id/primary key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment