I am using babel and ES6, I would like to know if it is possible to write the following code in a shorter way, specially I do not like the manual remap pf property in the return statement.
const locations = action.payload.list.map(location => {
return {
id: location.id,
name: location.name,
country: location.sys.country
}
})
via Radex
No comments:
Post a Comment