<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jon Randy 🎖️</title>
    <description>The latest articles on DEV Community by Jon Randy 🎖️ (@jonrandy).</description>
    <link>https://dev.to/jonrandy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F76131%2F7d2bf735-e6fe-42b4-8948-e5be83011f38.jpeg</url>
      <title>DEV Community: Jon Randy 🎖️</title>
      <link>https://dev.to/jonrandy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jonrandy"/>
    <language>en</language>
    <item>
      <title>I've asked this elsewhere and am amazed no-one could give a correct answer, let alone a short one...

What is the shortest JS you can think of to get the last non-empty element from an array?</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Fri, 13 Nov 2026 08:00:48 +0000</pubDate>
      <link>https://dev.to/jonrandy/ive-asked-this-elsewhere-and-am-amazed-no-one-could-give-a-correct-answer-let-alone-a-short-53pa</link>
      <guid>https://dev.to/jonrandy/ive-asked-this-elsewhere-and-am-amazed-no-one-could-give-a-correct-answer-let-alone-a-short-53pa</guid>
      <description></description>
    </item>
    <item>
      <title>Array.length Is NOT What You Think It Is</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Tue, 18 Aug 2026 07:40:03 +0000</pubDate>
      <link>https://dev.to/jonrandy/arraylength-is-not-what-you-think-it-is-2ikl</link>
      <guid>https://dev.to/jonrandy/arraylength-is-not-what-you-think-it-is-2ikl</guid>
      <description>&lt;p&gt;Ask many developers what the &lt;code&gt;length&lt;/code&gt; property of an array gives you in JS and you'll likely get some variation of the same answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The 'length' property tells you the number of elements in the array&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well, that's actually &lt;strong&gt;not&lt;/strong&gt; correct. The property &lt;em&gt;does&lt;/em&gt; tell you the length of the array (as its name implies) but that isn't the same as the number of elements. Unfortunately, many tutorial and reference websites also make this mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do we mean by 'array length'?
&lt;/h2&gt;

&lt;p&gt;The length of an array is actually the number of slots available to store elements in. So, the following array has a length of &lt;code&gt;4&lt;/code&gt; because it has that many slots available for storing elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point you may be thinking "Yes, but the number of elements in the array is always the same as the length" - and this is where you'd be wrong. Let's remove the number &lt;code&gt;4&lt;/code&gt; from the array (at index 3):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// still 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, deleting an element from an array doesn't change the length of the array - despite the fact that there are now only 3 elements in the array.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sparse Arrays
&lt;/h2&gt;

&lt;p&gt;Arrays containing 'holes' (like &lt;code&gt;arr&lt;/code&gt; above) are known as 'Sparse' arrays. You may think that the 'holes' are really just slots containing &lt;code&gt;undefined&lt;/code&gt;, and at first glance this does appear to be the case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;// undefined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we try to access the empty slot (3) - we get &lt;code&gt;undefined&lt;/code&gt;. This is not because it &lt;em&gt;contains&lt;/em&gt; &lt;code&gt;undefined&lt;/code&gt;, rather that the content is simply missing - and when we try to access a non-existent property on object (remember, arrays are objects) we see &lt;code&gt;undefined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Logging a sparse array to the console will report any slots with nothing in them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// [ 1, 2, 3, &amp;lt;1 empty slot&amp;gt; ]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The behaviour of empty slots can be further illustrated by using &lt;code&gt;forEach&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;// delete the number '3' this time&lt;/span&gt;
&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;// 1, 2, 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that only &lt;strong&gt;three&lt;/strong&gt; things were logged to the console. Contrast this with a similar non-sparse array that has &lt;code&gt;undefined&lt;/code&gt; at slot 2 instead of it being empty. You will notice that &lt;strong&gt;four&lt;/strong&gt; things are logged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;// 1, 2, undefined, 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not only the case with &lt;code&gt;forEach&lt;/code&gt; - most array iteration methods are 'sparse' aware.&lt;/p&gt;

&lt;p&gt;As well as deleting elements from 'full' arrays, sparse arrays can be created in other ways:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// create a sparse, empty array with length 4&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// another way to do this&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[,,,]&lt;/span&gt;

&lt;span class="c1"&gt;// create a sparse array with holes at slot 1 and 3&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The array &lt;code&gt;arr3&lt;/code&gt; above has a length of 5, but only contains 3 elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If asked about array length, the best answer you can probably give is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The length property of an array tells you &lt;strong&gt;&lt;em&gt;the number of slots in the array&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Whilst it is true that the number of elements stored in an array is very often the same as the array's length - these are very definitely two different things.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://notbyai.fyi/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A262%2Fformat%3Awebp%2F0%2ATmJE4bAgJ6qvbSnV" alt="Not by AI" width="262" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JavaScript Abuse: Pipelining Functions</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Thu, 09 Jul 2026 08:09:04 +0000</pubDate>
      <link>https://dev.to/jonrandy/javascript-abuse-pipelining-functions-4ioc</link>
      <guid>https://dev.to/jonrandy/javascript-abuse-pipelining-functions-4ioc</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;DISCLAIMER&lt;/u&gt;: Do NOT use this in production code. It's just a fun idea (full of potential danger) that &lt;em&gt;could&lt;/em&gt; lead to something more useful...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Okay, so we're going to make the following JS code work, even though it doesn't look like it should:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;addOne&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;half&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;addOne&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;half&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 2&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;half&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;addOne&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="c1"&gt;// [2.5, 3, 3.5]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How? Through the magic of JS features that you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Have always been told (weirdly) to avoid: &lt;strong&gt;type coercion&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Know about, but can't think of a use for: &lt;strong&gt;Symbols&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Regular viewers who've seen previous episodes such as '&lt;a href="https://dev.to/jonrandy/introducing-metho-safely-adding-superpowers-to-js-1lj"&gt;Metho&lt;/a&gt;', '&lt;a href="https://dev.to/jonrandy/turboprop-js-arrays-as-property-accessors-52h"&gt;Turboprop&lt;/a&gt;', and '&lt;a href="https://dev.to/jonrandy/ranger-js-range-syntax-for-anything-4djc"&gt;Ranger&lt;/a&gt;' will probably have a fairly good idea of how we're going to achieve this...&lt;/p&gt;

&lt;h2&gt;
  
  
  The Goal
&lt;/h2&gt;

&lt;p&gt;For the pipelining to work, essentially all we need is to make the following true:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;f[g] = x =&amp;gt; g(f(x))&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For ANY two functions &lt;strong&gt;f&lt;/strong&gt; and &lt;strong&gt;g&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;The function &lt;strong&gt;f&lt;/strong&gt; must have a method named with &lt;strong&gt;g&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;That method should be another function that is &lt;strong&gt;g&lt;/strong&gt; &lt;a href="https://en.wikipedia.org/wiki/Function_composition" rel="noopener noreferrer"&gt;composed&lt;/a&gt; with &lt;strong&gt;f&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we can achieve this, we can essentially make a pipeline of as many functions as we like.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Below is one way to achieve what we want. Please ask in the comments if there's anything you don't understand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// JS will attempt to coerce a function to a string when&lt;/span&gt;
&lt;span class="c1"&gt;// we attempt to use it as a property accessor on another function.&lt;/span&gt;
&lt;span class="c1"&gt;// We can hijack that process to perform our magic&lt;/span&gt;

&lt;span class="nb"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;Symbol&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toPrimitive&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// retain as much 'normal' coercion behaviour as we can&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hint&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;NaN&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hint&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;default&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="c1"&gt;// store a reference to the function being coerced - for later use&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;

  &lt;span class="c1"&gt;// create a unique symbol to use as the method key&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Symbol&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="c1"&gt;// create a unique method on the Function prototype&lt;/span&gt;
  &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;configurable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// use a getter so we have access to the target function (this)&lt;/span&gt;
    &lt;span class="c1"&gt;// when creating the method to return&lt;/span&gt;
    &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// remove the method when used - single use only&lt;/span&gt;
      &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nb"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="c1"&gt;// the method itself - our composed function x =&amp;gt; g(f(x))&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="c1"&gt;// self cleanup for stray tokens left behind from coercions&lt;/span&gt;
  &lt;span class="c1"&gt;// that could occur outside of an intended pipeline&lt;/span&gt;
  &lt;span class="nf"&gt;queueMicrotask&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nb"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="c1"&gt;// return the symbol we 'named' the method with - so it is&lt;/span&gt;
  &lt;span class="c1"&gt;// immediately invoked&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;References (MDN):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive" rel="noopener noreferrer"&gt;&lt;code&gt;Symbol.toPrimitive&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty" rel="noopener noreferrer"&gt;&lt;code&gt;Object.defineProperty&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/queueMicrotask" rel="noopener noreferrer"&gt;&lt;code&gt;queueMicrotask&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why is This Dangerous?
&lt;/h2&gt;

&lt;p&gt;This is obviously dangerous and/or flaky for a number of reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We're adding properties to language-level prototypes. This is generally a pretty bad idea, but we're adding properties keyed with Symbols so not risking collisions. However, there's still no guarantee this will not cause issues.&lt;/li&gt;
&lt;li&gt;Anything relying on coercion of functions to string primitives could well be trashed as we've modified the standard behaviour.&lt;/li&gt;
&lt;li&gt;It's not optimised - many identical functions will be recreated again and again.&lt;/li&gt;
&lt;li&gt;It will almost certainly have issues pipelining functions that use &lt;code&gt;this&lt;/code&gt;, although I'm not even sure what functionality one would expect in that case.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Could it be Made Safer/Better?
&lt;/h2&gt;

&lt;p&gt;The main way it could be made safer would probably be to mark or subclass pipelineable functions in some way - so that we could leave standard function behaviour intact. The problem with this is that we'd probably lose the nice syntax or, at the very least, end up with something less elegant.&lt;/p&gt;

&lt;p&gt;A way to improve it might be to assign the intermediate functions meaningful names constructed from the names of the pipelined functions - might be nice in stack traces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do this?
&lt;/h2&gt;

&lt;p&gt;Why not? 😀&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://notbyai.fyi/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A262%2Fformat%3Awebp%2F0%2ATmJE4bAgJ6qvbSnV" alt="Not by AI" width="262" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Far too many Packers and Packer-type thinking in software development and education. We need more Mappers!

Which are you?

#webdev #softwaredevelopment #programming

https://beautiful-programmers-stone.netlify.app/chapter-1#mappers-and-packers</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Sun, 28 Jun 2026 06:35:09 +0000</pubDate>
      <link>https://dev.to/jonrandy/far-too-many-packers-and-packer-type-thinking-in-software-development-and-education-we-need-more-39j</link>
      <guid>https://dev.to/jonrandy/far-too-many-packers-and-packer-type-thinking-in-software-development-and-education-we-need-more-39j</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://beautiful-programmers-stone.netlify.app/chapter-1#mappers-and-packers" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;beautiful-programmers-stone.netlify.app&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Function Names in JS Can't Contain Spaces, Right?</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Wed, 24 Jun 2026 11:28:13 +0000</pubDate>
      <link>https://dev.to/jonrandy/function-names-in-js-cant-contain-spaces-right-mp7</link>
      <guid>https://dev.to/jonrandy/function-names-in-js-cant-contain-spaces-right-mp7</guid>
      <description>&lt;h2&gt;
  
  
  WRONG!
&lt;/h2&gt;

&lt;p&gt;Despite the widespread belief that function names in JavaScript &lt;strong&gt;MUST&lt;/strong&gt; follow the same rules as identifiers - this is not actually true. Sure, when you use the &lt;code&gt;function&lt;/code&gt; keyword to define a function then the name you give in the code must follow the naming rules for identifiers i.e. cannot start with a number, cannot contain spaces, can only use certain characters etc.  However, it IS perfectly possible for the name of the function to contain spaces - or any other character. A function's name can actually be ANY string at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  OK... Explain?
&lt;/h2&gt;

&lt;p&gt;When you use the &lt;code&gt;function&lt;/code&gt; keyword, the name you provide is used as the function's &lt;strong&gt;&lt;em&gt;identifier&lt;/em&gt;&lt;/strong&gt; and is &lt;strong&gt;ALSO&lt;/strong&gt; used to set the name property of the created function - i.e. the function's name. That identifier is then used (scoped) in one of two ways depending on whether you are doing function declaration or function expression. The important thing here is that the function's identifier and the function's name happen to be the same, but are actually two different things. The fact that the language syntax mandates an identifier name here means that most of the time the function's name appears to be following the same rules... but it doesn't have to! There are other ways to set the name of a function:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using &lt;code&gt;Object.defineProperty&lt;/code&gt; - AFTER function creation&lt;/strong&gt;
A function's &lt;code&gt;name&lt;/code&gt; property is defined with &lt;code&gt;{ writable: false, configurable: true}&lt;/code&gt; - so we cannot set it directly by assigning our value to the property, but we can define it as follows:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;myFunc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
  &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFunc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my custom name 😛&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFunc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 'my custom name 😛'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using a property name trick - DURING function creation&lt;/strong&gt;
We can set the name at creation time without a separate step by use a computed property name trick, which leverages how JS infers names for object methods and functions:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my dynamic 🎉 name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="p"&gt;}[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "my dynamic 🎉 name"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  But This is Just a Trick That's Useless?
&lt;/h2&gt;

&lt;p&gt;You might think that, but it's actually used in many libraries - usually for making nice names to appear in stack traces (most modern JS engines will use a function's name property to refer to the function).&lt;/p&gt;

&lt;p&gt;Oh, and JavaScript actually already makes functions with names containing spaces... and you've probably already used this feature without knowing it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;myFunc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;func2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myFunc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;({})&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFunc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 'myFunc'&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;func2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 'bound myFunc'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yes, a function created by using &lt;code&gt;bind&lt;/code&gt; has a name containing a space.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A262%2Fformat%3Awebp%2F0%2ATmJE4bAgJ6qvbSnV" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A262%2Fformat%3Awebp%2F0%2ATmJE4bAgJ6qvbSnV" alt="written by human" width="262" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>The most interesting and fun projects to build are always the one ones with little to no practical use, and I thoroughly recommend building them 👍</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Fri, 01 Aug 2025 16:36:59 +0000</pubDate>
      <link>https://dev.to/jonrandy/the-most-interesting-and-fun-projects-to-build-are-always-the-one-ones-with-little-to-know-1o69</link>
      <guid>https://dev.to/jonrandy/the-most-interesting-and-fun-projects-to-build-are-always-the-one-ones-with-little-to-know-1o69</guid>
      <description></description>
      <category>sideprojects</category>
      <category>productivity</category>
      <category>career</category>
      <category>discuss</category>
    </item>
    <item>
      <title>"We are destroying software" - https://antirez.com/news/145</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Thu, 13 Feb 2025 02:18:35 +0000</pubDate>
      <link>https://dev.to/jonrandy/we-are-destroying-software-httpsantirezcomnews145-4l60</link>
      <guid>https://dev.to/jonrandy/we-are-destroying-software-httpsantirezcomnews145-4l60</guid>
      <description></description>
    </item>
    <item>
      <title>@ben The spam is still bad on the site. Any progress on solving this?</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Wed, 22 Jan 2025 11:15:40 +0000</pubDate>
      <link>https://dev.to/jonrandy/ben-the-spam-is-still-bad-on-the-site-any-progress-on-solving-this-4bbp</link>
      <guid>https://dev.to/jonrandy/ben-the-spam-is-still-bad-on-the-site-any-progress-on-solving-this-4bbp</guid>
      <description></description>
      <category>discuss</category>
      <category>devto</category>
    </item>
    <item>
      <title>Don't do this. Please. It's going to be even harder to discover decent content on here 😞</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Wed, 13 Nov 2024 00:56:55 +0000</pubDate>
      <link>https://dev.to/jonrandy/dont-do-this-please-its-going-to-be-even-harder-to-find-decent-content-on-here-2nnf</link>
      <guid>https://dev.to/jonrandy/dont-do-this-please-its-going-to-be-even-harder-to-find-decent-content-on-here-2nnf</guid>
      <description></description>
    </item>
    <item>
      <title>LLMs are Bullshitters 🐮💩</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Sat, 15 Jun 2024 07:17:13 +0000</pubDate>
      <link>https://dev.to/jonrandy/llms-are-bullshitters-1lm1</link>
      <guid>https://dev.to/jonrandy/llms-are-bullshitters-1lm1</guid>
      <description>&lt;p&gt;Just read a great paper on LLMs. I strongly suggest reading it, but here's the conclusion:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Investors, policymakers, and members of the general public make decisions on how to treat these machines and how to react to them based not on a deep technical understanding of how they work, but on the often metaphorical way in which their abilities and function are communicated. Calling their mistakes ‘hallucinations’ isn’t harmless: it lends itself to the confusion that the machines are in some way misperceiving but are nonetheless trying to convey something that they believe or have perceived. This, as we’ve argued, is the wrong metaphor. The machines are not trying to communicate something they believe or perceive. Their inaccuracy is not due to misperception or hallucination. As we have pointed out, they are not trying to convey information at all. They are bullshitting.&lt;/p&gt;

&lt;p&gt;Calling chatbot inaccuracies ‘hallucinations’ feeds in to overblown hype about their abilities among technology cheerleaders, and could lead to unnecessary consternation among the general public. It also suggests solutions to the inaccuracy problem which might not work, and could lead to misguided efforts at AI alignment amongst specialists. It can also lead to the wrong attitude towards the machine when it gets things right: the inaccuracies show that it is bullshitting, even when it’s right. Calling these inaccuracies ‘bullshit’ rather than ‘hallucinations’ isn’t just more accurate (as we’ve argued); it’s good science and technology communication in an area that sorely needs it.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://link.springer.com/article/10.1007/s10676-024-09775-5?error=cookies_not_supported&amp;amp;code=7b38b735-0944-48f1-bc8c-88805d23286b" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--A8LRFlfM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.springernature.com/full/springer-static/cover-hires/journal/10676" height="1063" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://link.springer.com/article/10.1007/s10676-024-09775-5?error=cookies_not_supported&amp;amp;code=7b38b735-0944-48f1-bc8c-88805d23286b" rel="noopener noreferrer" class="c-link"&gt;
          ChatGPT is bullshit | Ethics and Information Technology
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Recently, there has been considerable interest in large language models: machine learning systems which produce human-like text and dialogue. Applications of these systems have been plagued by persistent inaccuracies in their output; these are often called “AI hallucinations”. We argue that these falsehoods, and the overall activity of large language models, is better understood as bullshit in the sense explored by Frankfurt (On Bullshit, Princeton, 2005): the models are in an important way indifferent to the truth of their outputs. We distinguish two ways in which the models can be said to be bullshitters, and argue that they clearly meet at least one of these definitions. We further argue that describing AI misrepresentations as bullshit is both a more useful and more accurate way of predicting and discussing the behaviour of these systems.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--u5WPjvtG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://link.springer.com/oscar-static/img/favicons/darwin/android-chrome-192x192-6f081ca7e5.png" width="192" height="192"&gt;
        link.springer.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>ai</category>
      <category>llm</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>One Byte Explainer: Recursion</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Thu, 13 Jun 2024 07:52:02 +0000</pubDate>
      <link>https://dev.to/jonrandy/one-byte-explainer-recursion-9hn</link>
      <guid>https://dev.to/jonrandy/one-byte-explainer-recursion-9hn</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for DEV Computer Science Challenge v24.06.12: One Byte Explainer.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Explainer
&lt;/h2&gt;

&lt;p&gt;To understand recursion, see &lt;a href="https://dev.to/jonrandy/one-byte-explainer-recursion-9hn"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>cschallenge</category>
      <category>computerscience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Calculate the Nth Fibonacci Number</title>
      <dc:creator>Jon Randy 🎖️</dc:creator>
      <pubDate>Wed, 03 Apr 2024 08:50:27 +0000</pubDate>
      <link>https://dev.to/jonrandy/how-to-calculate-the-nth-fibonacci-number-1g49</link>
      <guid>https://dev.to/jonrandy/how-to-calculate-the-nth-fibonacci-number-1g49</guid>
      <description>&lt;p&gt;Okay, lets dive straight into the code...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fib&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;((((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation &lt;a href="https://akuli.github.io/math-tutorial/fib.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
