Let's say I have this object:
{
"cars":[
{"modell":"Volvo", "color":"blue", "origin":"Sweden"},
{"modell":"SAAB", "color":"black", "origin":"Sweden"},
{"modell":"Fiat", "color":"brown", "origin":"Italy"},
{"modell":"BMW", "color":"silver", "origin":"Germany"},
{"modell":"BMW", "color":"black", "origin":"Germany"},
{"modell":"Volvo", "color":"silver", "origin":"Sweden"}
]
}
First, I save the object to myCars.
1: I'd like to use javascript to extract the cars with the origin Sweden and then put those cars in a new object called mySwedishCars.
2: If that is more simple, I'd like to extract all non-swedish cars from the object myCars.
At the end, I would have to have an object that contains only Swedish cars.
Any suggestion would be welcome!