<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Control-Flow on Ghafoor's Personal Blog</title><link>https://ghafoorsblog.com/tags/control-flow/</link><description>Recent content in Control-Flow on Ghafoor's Personal Blog</description><generator>Hugo</generator><language>en</language><managingEditor>hello@ghafoorsblog.com (AG Sayyed)</managingEditor><webMaster>hello@ghafoorsblog.com (AG Sayyed)</webMaster><copyright>Copyright © 2024-2026 AG Sayyed. All Rights Reserved.</copyright><lastBuildDate>Sun, 24 May 2026 09:13:13 +0100</lastBuildDate><atom:link href="https://ghafoorsblog.com/tags/control-flow/index.xml" rel="self" type="application/rss+xml"/><item><title>JavaScript Conditionals and Control Flow — if, switch, Ternary, and the Modern Nullish Toolkit</title><link>https://ghafoorsblog.com/posts/js/04-conditionals/</link><pubDate>Sun, 08 Jun 2025 08:00:00 +0000</pubDate><author>hello@ghafoorsblog.com (AG Sayyed)</author><guid>https://ghafoorsblog.com/posts/js/04-conditionals/</guid><description>&lt;h2 id="why-this-still-matters"&gt;Why this still matters&lt;/h2&gt;
&lt;p&gt;Branching is the cheapest way to introduce subtle bugs in any language, and JavaScript adds a few of its own. Loose equality, the unique definition of &lt;em&gt;truthy&lt;/em&gt;, the difference between &lt;em&gt;undefined&lt;/em&gt; and &lt;em&gt;null&lt;/em&gt;, and several decades of habits picked up from other languages all conspire to make &lt;code&gt;if&lt;/code&gt; statements harder than they look.&lt;/p&gt;
&lt;p&gt;This post brings the basics together with the modern operators (&lt;code&gt;??&lt;/code&gt;, &lt;code&gt;?.&lt;/code&gt;, logical assignment) that often let you delete a conditional entirely.&lt;/p&gt;</description></item></channel></rss>