The length
is a property of strings, and can be destructured and returned in the map.
It’s mostly the same as:
materials.map((str) => {
const {length} = str;
return length;
});
The length
is a property of strings, and can be destructured and returned in the map.
It’s mostly the same as:
materials.map((str) => {
const {length} = str;
return length;
});