nguage-dart"><code>List&lt;int&gt; nums = [13, 2, -11];
nums.sort();
print(nums);  // [-11, 2, 13]
</code></pre>
<p>A <a href="../../dart-core/Comparator.html">Comparator</a> may compare objects as equal (return zero), even if they
are distinct objects.
The sort function is not guaranteed to be stable, so distinct objects
that compare as equal may occur in any order in the result:</p>
<pre class="language-dart"><code>List&lt;String&gt; numbers = ['one', 'two', 'three', 'four'];
numbers.sort((a, b) =&gt; a.l