How to do i get the id value
and brandName value
[{"id":24,"brandName":"BMW"},{"id":25,"brandName":"Mercedes Benz"}]
How to do i get the id value
and brandName value
[{"id":24,"brandName":"BMW"},{"id":25,"brandName":"Mercedes Benz"}]
Not sure what you're trying to do as your question is very vague. But if you want to iterate over each element and do something with the values you could do something like this:
let items = [{"id":24,"brandName":"BMW"},{"id":25,"brandName":"Mercedes Benz"}];
items.forEach(elem => {
const {id, brandName} = elem;
console.log(`ID: ${id}. Brand Name: ${brandName}.`);
})