I have a huge JSON code with over 4k lines to push info from and i don't really know whats the best way to push/return the string values that i need.
Note: the code is not actually a json file it's inside a string
I was thinking in maybe using slice for some of the info that i want and pushing into a array using the indexOf(), but this is probably the worst way.
eg.
product {
'name' : 'Backpack',
'color' : 'Blue',
'id' : 101,
'is_in_stock' : 'true'
'image_url' : {
'link_1' : 'url',
'link_2' : 'url2'
}
}
product {
'name' : 'Backpack',
'color' : 'Red',
'id' : 102,
'is_in_stock' : 'true'
'image_url' : {
'link_1' : 'url',
'link_2' : 'url2'
}
}
product {
'name' : 'Backpack',
'color' : 'Green',
'id' : 103,
'is_in_stock' : 'true'
'image_url' : {
'link_1' : 'url',
'link_2' : 'url2'
}
}
Basically need to build a function to filter id and other stuff?