I have an object as follows:
asset: {
images []
}
Images look like this:
image {
width,
height,
fileName
}
I need to project all of the image filenames into an array. The obvious implementation is the following:
var fileNames = [];
var i;
for (i = 0; i < asset.images.length; i++) {
fileNames.push(asset.images[i].fileName);
}
Does anybody know of a fancy way to do this in 1 or 2 lines? You can use jQuery or angularJs