I'm trying to get from here:
example = [{ name: "someone1", city: "somewhere1", state: "someplace1" },{ name: "someone2", city: "somewhere2", state: "someplace2" }]
here:
example.name = [ "someone1", "someone2" ]
As little code as possible. Obviously, I could just loop it and build an array, but I need to do this many times on different objects. I could write a function to do this, but it would be difficult to make a function common enough for my application.
Is there a shortcut for this in jQuery?
javascript jquery arrays
awimley
source share