Modify array of arrays to create custom array of objects
Overview


You're overwriting the name array in defining the mapping param.
You don't need to assign to a new object. This is done for you.


Rewrite

function modifyArray(arrays) {
    return arrays.map(array =&gt; {
        return { coordinates: array.slice(0, 2), reach: array[2], power: 0 };
    });
}