for example…
if ( /* Condition */ ) {
if ( /* Condition */ ) {
if ( /* Condition */ ) {
// Superb!
} else {
// Error 3
}
} else {
// Error 2
}
} else {
// Error 1
}
Do you know how to avoid this? Thank you!
If this is a library function,
throwmay be the appropriate action.Other acceptable actions might be:
0,null, orundefined.You will have to determine which failure action is right for your use case.