Categories
User Help Web Pro

What is the difference of an `if` statement that has an {open-close} brackets, and without {open-close} brackets [closed]

if statement has an open {} close brackets

  if(example){
      return example;
  }else{
      return example;
  }

if statement without open {} close brackets

  if(example)
      return example;
  else
      return example;

Can anyone explain to me about the pros and cons of using them? Thanks in advance 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *