<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jon Manga on Medium]]></title>
        <description><![CDATA[Stories by Jon Manga on Medium]]></description>
        <link>https://medium.com/@jonmanga?source=rss-9d4b42762f23------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*we0o8hF2scmLtUUb.</url>
            <title>Stories by Jon Manga on Medium</title>
            <link>https://medium.com/@jonmanga?source=rss-9d4b42762f23------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:46:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jonmanga/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to return a default value for undefined object properties in JavaScript.]]></title>
            <link>https://medium.com/@jonmanga/how-to-return-a-default-value-for-undefined-object-properties-in-javascript-8aa297c77ff7?source=rss-9d4b42762f23------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aa297c77ff7</guid>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[default-value]]></category>
            <category><![CDATA[switch]]></category>
            <category><![CDATA[objects]]></category>
            <dc:creator><![CDATA[Jon Manga]]></dc:creator>
            <pubDate>Wed, 11 Mar 2020 10:02:30 GMT</pubDate>
            <atom:updated>2020-03-11T10:12:01.724Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pJbt849T7p6Io4q4" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>JavaScript objects are great and it’s often easy to check for values in objects compared to other data structures in JavaScript. Objects are cheap to access and you get undefined when you access a property that doesn’t exist in the object. But, what if you want to override this behaviour and return a <strong>default</strong> value when trying to access an undefined property?</p><p>In JavaScript, you can do this using the Proxy object. The Proxy object wraps the target object and overrides its behaviour by setting traps. To return a default value for an undefined object property, you can set a get trap in the Proxy handler which returns the <strong>default value</strong>. See an example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44218b93ffbaa9215f23a389ddca66db/href">https://medium.com/media/44218b93ffbaa9215f23a389ddca66db/href</a></iframe><p>Let’s say you have an individual colour allocation for scores 0–2 and a default colour for any other score. You can use a Proxy object to look up the colour of the score as shown in the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e748eb16d0bfc1f954c82c296580e93f/href">https://medium.com/media/e748eb16d0bfc1f954c82c296580e93f/href</a></iframe><p>If you try to access scoreColors[5] you will get ‘GREEN’</p><p>Proxies are a good alternative to switch statements and multiple condition checks.</p><p>There’s a lot more you can do with proxies and you can learn more here:<br><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aa297c77ff7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Design Footnote on Infinite Scroll]]></title>
            <link>https://medium.com/@jonmanga/a-design-footnote-on-infinite-scroll-e1d35fd46f46?source=rss-9d4b42762f23------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1d35fd46f46</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[website-design]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[infinite-scroll]]></category>
            <dc:creator><![CDATA[Jon Manga]]></dc:creator>
            <pubDate>Mon, 05 Feb 2018 16:35:54 GMT</pubDate>
            <atom:updated>2018-02-05T16:39:45.122Z</atom:updated>
            <content:encoded><![CDATA[<p>Infinite scroll is a technique for continuously loading content without the need for pagination, an awesome feature but sometimes badly utilized.</p><p>Its purpose is to reveal more content, but in some cases it ends up hiding essential information. This is especially true if the information resides at the bottom of the page. Unless you have a slow internet, it’s almost impossible to catch the information in the footer. It’s a struggle to say the least!</p><p>With this in mind it is therefore necessary for a website making use of infinite scroll to provide an easier way to access information at the bottom of the page. There are various ways to achieve it, including but not limited to:</p><p>1. Fixed footer</p><p>2. Hide/unhide footer on action or scroll.</p><p>3. Fixed footer menu button.</p><p>Your users may never reach the end of <strong>infinity</strong>, but please help them easily access other information on your website.</p><p>I had a hardtime finding the about page for <strong>meduim.com</strong> because of infinite scroll, at a point I even thought they didn’t have one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1d35fd46f46" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>