<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[No-argument sort() is a no-op on strings - bug?]]></title><description><![CDATA[<p dir="auto">A no-argument (not passing a comparator function) call to <code>sort()</code> on strings in an unexpected no-op.</p>
<p dir="auto">Seems like a bug?</p>
<p dir="auto">Docs: <a href="https://docs.hise.dev/scripting/scripting-api/array/index.html#sort" rel="nofollow ugc">https://docs.hise.dev/scripting/scripting-api/array/index.html#sort</a></p>
<p dir="auto"><img src="/assets/uploads/files/1788531629345-cleanshot-2026-09-04-at-15.19.11-2x.png" alt="CleanShot 2026-09-04 at 15.19.11@2x.png" class=" img-fluid img-markdown" /></p>
<pre><code>const var n = [3, 1, 2];
const var s = ["b", "c", "a"];

Console.print(trace(n.sort()));        // ✅ [3, 1, 2] becomes [1, 2, 3]
Console.print(trace(s.sort()));        // ❌ stays ["b", "c", "a"]
Console.print(trace(s.sortNatural())); // ✅ properly sorted as ["a", "b", "c"]
</code></pre>
<p dir="auto"><code>sortNatural()</code> is the function that works for sorting strings.</p>
]]></description><link>https://forum.hise.audio/topic/15030/no-argument-sort-is-a-no-op-on-strings-bug</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 17:19:51 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/15030.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Sep 2026 14:25:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to No-argument sort() is a no-op on strings - bug? on Fri, 04 Sep 2026 15:12:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/357">@dannytaurus</a> said in <a href="/post/122790">No-argument sort() is a no-op on strings - bug?</a>:</p>
<blockquote>
<p dir="auto">So you think the docs are wrong, rather than it being a bug?</p>
</blockquote>
<p dir="auto">Could be either</p>
]]></description><link>https://forum.hise.audio/post/122791</link><guid isPermaLink="true">https://forum.hise.audio/post/122791</guid><dc:creator><![CDATA[David Healey]]></dc:creator><pubDate>Fri, 04 Sep 2026 15:12:24 GMT</pubDate></item><item><title><![CDATA[Reply to No-argument sort() is a no-op on strings - bug? on Fri, 04 Sep 2026 15:09:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/12">@David-Healey</a> So you think the docs are wrong, rather than it being a bug?</p>
<p dir="auto">If it's intentional behaviour I won't file a fix. But if it's a bug, it should get fixed because it's one of those silent time-wasters that can grind productivity to a halt.</p>
]]></description><link>https://forum.hise.audio/post/122790</link><guid isPermaLink="true">https://forum.hise.audio/post/122790</guid><dc:creator><![CDATA[dannytaurus]]></dc:creator><pubDate>Fri, 04 Sep 2026 15:09:08 GMT</pubDate></item><item><title><![CDATA[Reply to No-argument sort() is a no-op on strings - bug? on Fri, 04 Sep 2026 14:54:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/357">@dannytaurus</a> I made a video about sorting and I hadn't even noticed the docs are wrong.</p>
<p dir="auto"><a href="https://www.youtube.com/watch?v=qeUq-M6CgTs" rel="nofollow ugc">https://www.youtube.com/watch?v=qeUq-M6CgTs</a></p>
]]></description><link>https://forum.hise.audio/post/122789</link><guid isPermaLink="true">https://forum.hise.audio/post/122789</guid><dc:creator><![CDATA[David Healey]]></dc:creator><pubDate>Fri, 04 Sep 2026 14:54:57 GMT</pubDate></item></channel></rss>