Description
Generating code from the decision tree can result in this kind of structure on the JS target:
if (cond) {
// ...
} else {
if (other_cond) {
// ...
} else {
// ...
}
}
It would be a nice touch if the generated code looked like this instead:
if (cond) {
// ...
} else if (other_cond) {
// ...
} else {
// ...
}
This is not as straightforward as it seems since sometimes we might have variable definitions in between an else
and the nested if
, making it impossible to collapse into an else if
.