The map() method creates a new array with the results of calling a provided function on every element in the calling array.
So, basically it goes like this:
let colorsArray = fruits.map( (obj) => {
return obj.color;
}
in es6, when you have an annonymous function with only a return statement you can omit the function square brackets, omit the arguments normal brackets (assuming you have only one argument, which u do in this case) and the return statement, which also makes it possible to write it all on the same line without losing readability, so it becomes:
let colorsArray = fruits.map( obj => obj.color );
If you're not familiar with the arrow function syntax, I advise reading more about it (here is a nice start).