title: What is the difference between "def" and "val" to define a function
body: <p>What is the difference between:</p>
  
  <pre><code>def even: Int =&gt; Boolean = _ % 2 == 0
  </code></pre>
  
  <p>and </p>
  
  <pre><code>val even: Int =&gt; Boolean = _ % 2 == 0
  </code></pre>
  
  <p>Both can be called like <code>even(10)</code>.</p>