The reduce in your example is bad because it is not a reduce, its should be a map, reduce is for reducing the entirety to one value normally to sum or average or something.
if(!props.item&&props.item.details){return;}props.item.details.clients.map(function(client){returnclient.errorConfigurations.map(function(config){usedIn:client.client.name,errorMessage:config.error.message,errorLevel:config.error.level});}).flat();// I did not test this at all, I take no responsibility for anything
Also using the function(){} syntax is still useful if you give the function a name, helps give it some extra semantics over the use of arrow functions.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The reduce in your example is bad because it is not a reduce, its should be a map, reduce is for reducing the entirety to one value normally to sum or average or something.
Also using the
function(){}
syntax is still useful if you give the function a name, helps give it some extra semantics over the use of arrow functions.