how to get the first elements of array of objects in another array in javascript code example Example: js copy array into another var destinationArray = Array.from(sourceArray);