<?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 Alexander on Medium]]></title>
        <description><![CDATA[Stories by Alexander on Medium]]></description>
        <link>https://medium.com/@AlexanderOkoli?source=rss-93f6d90b8c8f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*t8qplPeo1rS1lDLH.jpeg</url>
            <title>Stories by Alexander on Medium</title>
            <link>https://medium.com/@AlexanderOkoli?source=rss-93f6d90b8c8f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:39:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@AlexanderOkoli/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[Optional Chaining in JavaScript]]></title>
            <link>https://medium.com/@AlexanderOkoli/optional-chaining-in-javascript-da5478ce25d9?source=rss-93f6d90b8c8f------2</link>
            <guid isPermaLink="false">https://medium.com/p/da5478ce25d9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Alexander]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 17:06:58 GMT</pubDate>
            <atom:updated>2020-06-08T17:09:26.069Z</atom:updated>
            <content:encoded><![CDATA[<p>Using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining">Optional Chaining</a> can prevent bugs. Consider this piece of code,</p><pre>const result = item.nestedItem1.nestedItem2.nestedItem3</pre><p>when run, the code will crash when some item in the chain (e.g. nestedItem1) is undefined or null</p><p>Though it can be fixed by writing,</p><pre>const result = item &amp;&amp; item.nestedItem1 &amp;&amp; item.nestedItem1.nestedItem2 &amp;&amp; item.nestedItem1.nestedItem2.nestedItem3</pre><p>That is verbose. Instead, use the optional chaining equivalent</p><pre>const result = item?.nestedItem1?.nestedItem2?.nestedItem3</pre><p>If any item in the chain is undefined or null, the result variable will be undefined but the app doesn’t crash.</p><p>If you’re working on React, using Create React App (CRA), version 3.3.0 added <strong>Optional Chaining:</strong><br><a href="https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#330-2019-12-04">https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#330-2019-12-04</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da5478ce25d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>