Created
September 7, 2018 10:34
-
-
Save abel-masila/b5eb8dde25a96731dcfa4d4dfb946d30 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
const variants=[ | |
{"id":1,"name":"shoes","color":"red"}, | |
{"id":2,"name":"food","color":"blue"}, | |
{"id":3,"name":"car","color":"yellow"}, | |
]; | |
// I want to extract the keys and values from this data and create a new array which looks like: | |
// newAyy=[ | |
// {id:["1","2","3"]}, | |
// {name:["shoes","food","car"]}, | |
// {color:["red","blue","yellow"]} | |
// ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment