<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ECMAScript on Elliot Sachs</title><link>https://www.elliotsachs.com/tags/ecmascript/</link><description>Recent content in ECMAScript on Elliot Sachs</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Copyright © 2026 Elliot Sachs</copyright><lastBuildDate>Sat, 25 Nov 2017 16:50:24 +0000</lastBuildDate><atom:link href="https://www.elliotsachs.com/tags/ecmascript/index.xml" rel="self" type="application/rss+xml"/><item><title>How To Create A Singly Linked List In JavaScript</title><link>https://www.elliotsachs.com/how-to-create-a-singly-linked-list-in-javascript/</link><pubDate>Sat, 25 Nov 2017 16:50:24 +0000</pubDate><guid>https://www.elliotsachs.com/how-to-create-a-singly-linked-list-in-javascript/</guid><description>&lt;p&gt;Linked Lists are relatively common and simple data structures that allow us to &amp;rsquo;link&amp;rsquo;/chain data together. Linked Lists are useful for insertion/deletion (time complexity of &lt;code&gt;O(1)&lt;/code&gt;), but are unfortunately not incredibly efficient when it comes to access and search (time complexity of &lt;code&gt;O(n)&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;The core idea behind a linked list is that you have nodes that contain two pieces of information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The data itself&lt;/li&gt;
&lt;li&gt;A pointer towards the next piece of data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The pointer is what chains the pieces of data together and creates the linked list.&lt;/p&gt;</description></item><item><title>List of Falsy Values in JavaScript &amp; ToBoolean Algorithm</title><link>https://www.elliotsachs.com/list-of-falsy-values-in-javascript-toboolean-algorithm/</link><pubDate>Sat, 18 Nov 2017 14:51:43 +0000</pubDate><guid>https://www.elliotsachs.com/list-of-falsy-values-in-javascript-toboolean-algorithm/</guid><description>&lt;p&gt;Here&amp;rsquo;s a no frills post about the falsy values in JS. In case you didn&amp;rsquo;t know, JavaScript considers some values as truthy and other as falsy. Most are deemed truthy so it&amp;rsquo;s a lot easier to simply remember the falsy ones.&lt;/p&gt;
&lt;p&gt;You can see the truthy vs falsy evaluation in action when using an if statement. The statement takes in an expression and coerces it to a boolean value using the ToBoolean algorithm. The result is predictable and outlined in the table provided by the ECMAScript spec. Here it is below:
Argument TypeResultCompletion RecordIf argument is an abrupt completion, return argument. Otherwise return ToBoolean(argument.[[value]]).UndefinedReturn false.NullReturn false.BooleanReturn argument.NumberReturn false if argument is +0, −0, or NaN; otherwise return true.StringReturn false if argument is the empty String (its length is zero); otherwise return true.SymbolReturn true.ObjectReturn true.
So just to recap, the falsy values are:&lt;/p&gt;</description></item></channel></rss>