Indentation that follows the level of nesting would help me understand what is happening:
constvalidateInput=({field1,field2,field3})=>(!field1?Promise.reject('Missing field1'):!Array.isArray(field2)?Promise.reject('field2 is not an array'):!isValidType(field3)?Promise.reject('field3 is invalid'):Promise.resolve())
I'm not sure I got the evaluation order right, and I'd be suspicious about it in somebody else's code. Usually I'd use parentheses to make sure, but that might make it less readable with a lot of nesting.
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.
Indentation that follows the level of nesting would help me understand what is happening:
I'm not sure I got the evaluation order right, and I'd be suspicious about it in somebody else's code. Usually I'd use parentheses to make sure, but that might make it less readable with a lot of nesting.