Created
November 23, 2018 06:17
-
-
Save hprobotic/a1edef65e7a969cb84815dad5fa1e44d 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
| Givens a data.json file with structure bellow: | |
| // data.json | |
| [ | |
| { | |
| "name": "Electronics", | |
| "items": ["Phone", "Keyboards"] | |
| }, | |
| { | |
| "name": "Keyboards", | |
| "items": ["Filco", "Razer"] | |
| }, | |
| { | |
| "name": "Cars", | |
| "items": ["Hatchback", "MPV"] | |
| }, | |
| { | |
| "name": "Hatchback", | |
| "items": ["Honda", "Ferrari"] | |
| }, | |
| { | |
| "name": "Phone", | |
| "items": ["Apple", "Samsung"] | |
| } | |
| ] | |
| Goal is convert this table into structure that able to use to build mega menu structure bellow | |
| ``` | |
| |- Electronics | |
| | |- Phone | |
| | | |- Apple | |
| | | |- Samsung | |
| | |- Keyboards | |
| | | |- Razer | |
| | . | . |- Filco | |
| |- Cars | |
| | |- Hatchback | |
| | | |- Honda | |
| | | |- Ferrari | |
| | |- MPV | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment