DEV Community

Discussion on: if statements by a n00b

Collapse
 
shane325 profile image
Shane Barry

Good job. FYI the syntax is else if, not if else

if (condition1) {
  //  block of code to be executed if condition1 is true
} else if (condition2) {
  //  block of code to be executed if the condition1 is false and condition2 is true
} else {
  //  block of code to be executed if the condition1 is false and condition2 is false
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
snazer profile image
Santiago N

thanks man I appreciate it, like I said n00b lol