-3

In the scenario where the else statement is blank, is it's inclusion necessary? IE:

if (condition) {
function
}
else {}

or

if (condition) {
function
}
Hello World
  • 1,102
  • 2
  • 15
  • 33

1 Answers1

1

The inclusion of the else statement is not necessary.

if (condition) {
    function();
}

is enough.

Raidri
  • 17,258
  • 9
  • 62
  • 65