-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
  • 962
  • 2
  • 15
  • 31

1 Answers1

1

The inclusion of the else statement is not necessary.

if (condition) {
    function();
}

is enough.

Raidri
  • 16,630
  • 9
  • 58
  • 64