title: What is the default return value of a Dart function?
body: <p>The function below works even though I intentionally deleted 'return' command:</p>
  
  <pre class="lang-dart prettyprint-override"><code>main() {
    add(i) =&gt; i + 2; //I intentionally deleted 'return'
    print(add(3)); //5
  }
  </code></pre>
  <p>But, the function below doesn't work after I intentionally deleted the 'return' command.</p>
  <pre class="lang-dart prettyprint-override"><code>main() {
  makeAdder(num addBy) {
   return (num i) {
      addBy + i; //I intentionally deleted 'return'
    }; 
  }
  
   var add2 = makeAdder(2); 
    print(add2(3) ); //expected 5, but null.
  }
  </code></pre>
  <p><strong>Edited to clarify my question.</strong></p>
  <p>The last sentence in the latter function above, add2(3) doesn't return a value(I expect 5) but just null returns.</p>
  <p>My question is why 'addBy + i' of the latter function doesn't return contrary to the fact that 'add(i) =&gt; i + 2' of the first function returns 'i + 2'.</p>
  <p><strong>Edited again</strong>.
  <strong>The answer is in the fact of '=&gt;' being {return }, not just {}.</strong></p>
  <pre class="lang-dart prettyprint-override"><code>main() {
  makeAdder(num addBy) =&gt; (num i) { return addBy + i; }; 
  
  
   var add2 = makeAdder(2); 
    print(add2(3) ); // 5
  }
  </code></pre>
  <p>Even the code below works as '=&gt;' has 'return' command in it.</p>
  <pre class="lang-dart prettyprint-override"><code>main() {
  makeAdder(num addBy) =&gt; (num i) =&gt; addBy + i; ; 
  
  
   var add2 = makeAdder(2); 
    print(add2(3) ); //5
  } 
  </code></pre>