title: What's the advantage of creating a one line function that contains a string, that wouldn't be achievable by just assigning a string to a variable?
body: <p>In Kotlin, I understand that a string can be assigned to a function directly, such as:</p>
  
  <pre><code>fun foo(): String = "Hello World"
  </code></pre>
  
  <p>But you can also assign a String to a variable directly as well:</p>
  
  <pre><code>var foobar: String = "Hello Word"
  </code></pre>
  
  <p>My question is, why would you ever create a function when you could just create a variable? I can't see the point in the existence of this functionality.</p>