Last active
January 9, 2017 00:21
-
-
Save michael-mafi/e95c4fcd5802f8f74e8d777210a62fdb 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
| //use a var arr = [[[]]]; //////// also side note: don't forget Object.keys() Object.values() and Object.entries() | |
| function transformData(arr){ | |
| var output = {}; | |
| array.forEach(function(item, index){ | |
| if(!item)return; | |
| if(Array.isArray(item)){ | |
| output[index] = transformData(item); | |
| }else{ | |
| output[index] = item; | |
| } | |
| }); | |
| return output; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment