title: Def vs. val, functional syntax not working in Scala.js?
body: <p>To give you a minimal example:</p>
  
  <pre><code>object Main extends JSApp
  {
     val someThing: String = determineSomething("test")   
  
     def main(): Unit =
     {
         println(someThing)
     }
  }
  </code></pre>
  
  <p>Now, two possibilities here:</p>
  
  <pre><code>private def determineSomething(s: String): String = "succeeded"
  </code></pre>
  
  <p>If the project is executed like this, well, I get a log entry saying </p>
  
  <blockquote>
    <p>succeeded</p>
  </blockquote>
  
  <p>But when I use the more functional syntax:</p>
  
  <pre><code>private val determineSomething: (s: String) =&gt; "succeeded"
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>TypeError: this.determineSomething$1 is null
  </code></pre>
  
  <p>I am curious as to the why this happens as in the (JVM) repl, both ways work perfectly fine.</p>