Having trouble with JavaScript arrays, specifically copyCommands
. I need to insert another array of items into the parent object called autoGenData
.
//autoGenData is the main object and copyCommands is an array
autoGenData.copyCommands.push({
CopyFrom: UnitFrom,
//CopyTo: //an array meant for holding CopyOptions and Unit
});
//Looking to include the following in CopyTo
//CopyOptions: checkedItems,
//Unit: localUnitTo
What's the correct syntax for adding CopyOptions
and unit
to the CopyTo
part of the push
command?