I like multiple conditionals, but I make sure to keep some sort of nesting and breaking strategy to keep it readable. Innately, I can't think of a reason not to use nested other than readability, so if future you will still know what it does, go for it!
Most likely, I would have written that as
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())
Whatever way works for you to see the ifs and elses without hunting for them.
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.
I like multiple conditionals, but I make sure to keep some sort of nesting and breaking strategy to keep it readable. Innately, I can't think of a reason not to use nested other than readability, so if future you will still know what it does, go for it!
Most likely, I would have written that as
Whatever way works for you to see the ifs and elses without hunting for them.