title: How to exit GUARD outside and inside a function - Swift
body: <p>In the following code I am practicing the use of GUARD (Book: OReilly Learning Swift) </p>
  
  <pre><code>guard 2+2 == 4 else {
  print("The universe makes no sense")
  return // this is mandatory!
  }
  print("We can continue with our daily lives")
  </code></pre>
  
  <p>Why do I get the following code error?</p>
  
  <p><code>error: return invalid outside of a func</code></p>
  
  <p>Or is GUARD only used within functions?</p>