js copy map code example
Example 1: javascript copy array map
workers = workers.map(employee =>
employee.occupation == "Iron Man" ? (employee.occupation = "Philantropist", employee) : (employee.occupation, employee)
);
Example 2: javascript copy array map
array.map((employee) => Object.assign({ }, employee))