well I guess you would have to push those values onto the layerIds array, preferably in a loop.
to cut down on all that push repetition, you can construct the original array like this:
var x = [{layerId: 2, layerName: 'Counties'},
{layerId: 3, layerName: 'States'}];
and once you have done with that, like I say, loop through the x array, pushing the layerId values onto your layerIds array
although if you are using jQuery I think (but I don't know because I don't use it) that there are some built-in methods for cloning arrays and objects - maybe you can mix n match
Bookmarks