<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hoisting on Coderrob</title><link>https://coderrob.com/tags/hoisting/</link><description>Recent content in Hoisting on Coderrob</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 26 Apr 2026 10:00:00 -0500</lastBuildDate><atom:link href="https://coderrob.com/tags/hoisting/index.xml" rel="self" type="application/rss+xml"/><item><title>JavaScript Hoisting Explained</title><link>https://coderrob.com/posts/javascript-hoisting-explained/</link><pubDate>Sun, 26 Apr 2026 10:00:00 -0500</pubDate><guid>https://coderrob.com/posts/javascript-hoisting-explained/</guid><description>&lt;p&gt;Hoisting is JavaScript&amp;rsquo;s setup behavior for declarations.&lt;/p&gt;
&lt;p&gt;It affects whether a function or variable can be used before the line where it appears in the file. That matters because &lt;code&gt;function&lt;/code&gt;, &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, and &lt;code&gt;const&lt;/code&gt; do not all behave the same way.&lt;/p&gt;
&lt;p&gt;This post is about two questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;When does JavaScript create the name?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What value, if any, is available before the declaration line runs?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Hoisting is usually explained as &amp;ldquo;JavaScript moves declarations to the top.&amp;rdquo;&lt;/p&gt;</description></item></channel></rss>