title: Simple scala code: Returning first element from string array
body: <p>I don't know how to fix this code. It "explodes" somewhere in <strong>returnFirstString</strong> but I don't know why. Also, I don't know how to properly display result using <strong>println</strong>. Is this approach ok.</p>
  
  <p>So here's the code:</p>
  
  <pre><code>def returnFirstString(a: Array[String]): Option[String]=
  {
      if(a.isEmpty) { None }
      Some(a(0))
  }
  val emptyArrayOfStrings = Array.empty[String]
  println(returnFirstString(emptyArrayOfStrings))
  </code></pre>