So, I'm a SQL developer who now finds himself writing JavaScript and I have no idea what I'm doing. I need help querying objects. Let's say I have the following array of objects
var addresses = [
{ street: '104 Bob st', city: 'Boringville', state: 'NC' },
{ street: '207 Ted rd', city: 'Quiettown', state: 'NC' },
{ street: '309 Jim ln', city: 'Lameburg', state: 'VA' }
];
I need to do things like get a list of states, or towns. In SQL that's a piece of cake it's just SELECT city FROM addresses, or SELECT DISTINCT state FROM addresses, or whatever you need to do. How in the world would you do this in JavaScript though?