e associated to <code>key</code>, if there is one.
Otherwise calls <code>ifAbsent</code> to get a new value, associates <code>key</code> to
that value, and then returns the new value.</p>
<pre class="language-dart"><code>Map&lt;String, int&gt; scores = {'Bob': 36};
for (var key in ['Bob', 'Rohan', 'Sophena']) {
  scores.putIfAbsent(key, () =&gt; key.length);
}
scores['Bob'];      // 36
scores['Rohan'];    //  5
scores['Sophena'];  //  7
</code></pre>
<p>Calling <code>ifAbsent</code> must not add or remove k