else if works with exceptions, e.g, the if after the else is always considered to be a child of else, 

if(true) {
  //...
} else if (true) {
  //...
}

becomes 


if(true) {
  //...
} else {
  if (true) {
    //...
  }
}