I am trying to create a new array out of limited values from an existing array. In the example below LargeArray contains many attributes – year, books, gdp and control. Lets say I want to create a new array that would only include year and gdp.
var LargeArray = [
{year:1234, books:1200, gdp:1200, control:1200},
{year:1235, books:1201, gdp:1200, control:1200},
{year:1236, books:1202, gdp:1200, control:1200}
];
The new array I am trying to get, would look like this:
var NewArray = [
{year:1234, gdp:1200},
{year:1235, gdp:1200},
{year:1236, gdp:1200}
];