How do I make this if else more simple.
if (!request) {
return 'no request';
} else {
if (loading === '404') {
return 'rejected';
}
if (loading === '200' && !array1.length) {
return 'fulfilled';
}
}
if any ternary operator then how can I make it
else condition. What if all the condition is not fullfilled? I think you should return something if nothing fullfilled.returninifyou don't needelsethis convention would flatten your code.