Why numbering should start at zero (1982)
Absolutely not, quoting from here: <a href="https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;theory#notes" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amark&#x2F;theory#notes</a><p>1. Naturally, the first element in a list cardinally corresponds to 1. Contrarily, even official documentation of JavaScript has explicit disclaimers that the &quot;first element of an array is actually at index 0&quot; - this is easily forgotten, especially by novices, and can lead to errors.<p>2. Mathematically, a closed interval is properly represented in code as for(i = 1; i &lt;= items.length; i++), because it includes its endpoints. Offset notation instead is technically a left-closed right-open interval set, represented in code as for(i = 0; i &lt; items.length; i++). This matters because code deals with integer intervals, because all elements have a fixed size - you can not access a fractional part of an element. Integer intervals are closed intervals, thus conclusively proving this importance.<p>3. Mathematically, matrix notation also starts with 1.<p>4. The last element in a list cardinally corresponds to the length of the list, thus allowing easy access with items.length rather than having frustrating (items.length - 1) arithmetic everywhere in your code.<p>5. Negative indices are symmetric with positive indices. Such that -1 and 1 respectively refer to the last and first element, and in the case where there is only one item in the list, it matches the same element. This convenience allows for simple left and right access that offset notation does not provide.<p>6. Non existence of an element can be represented by 0, which would conveniently code elegantly as if( !items.indexOf(&#x27;z&#x27;) ) return;. Rather, one must decide upon whether if( items.indexOf(&#x27;z&#x27;) == -1 ) return; is philosophically more meaningful than if( items.indexOf(&#x27;z&#x27;) &lt; 0 ) return; with offset notation despite ignoring the asymmetry of the equation.