I have an array object in javascript. I would to select a particular field from all the rows of the object.
I have an object like
var sample = {
[Nam
That Javascript has no meaning. It is syntatically incorrect. I assume you meant:
var sample = [
{Name:"a",Age:1},
{Name:"b",Age:2},
{Name:"c",Age:3}
]
Then you can use jQuery to do something like this:
var names = $(sample).map(function(){ return this.Name; });
But in reality all jQuery is doing is looping through the object for you. Writing your own loop would be (insignificantly) faster. There is no way to do this without a loop.