FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Question of the Day #22 [Talk::Overflow]
NewsWeb Development

Question of the Day #22 [Talk::Overflow]

via Dev.to JavaScriptValPetal Tech Labs1mo ago

Why a function declaration after a return statement still shadows your outer variable — and how this "dead code" hoisting trap silently breaks state updates in production JavaScript. This post explains a quiz originally shared as a LinkedIn poll . 🔹 The Question var x = 1 ; function bar () { x = 10 ; console . log ( x ); return ; function x () {} } bar (); console . log ( x ); Hint: Before any code inside a function runs, the engine has already processed all declarations in the function body — including ones that appear after a return statement. Follow me for JavaScript puzzles and weekly curations of developer talks & insights at Talk::Overflow: https://talkoverflow.substack.com/ 🔹 Solution Correct answer: B) 10, 1 The first console.log prints 10 . The second prints 1 . 🧠 How this works This quiz exploits the fact that function declarations are hoisted to the top of their enclosing function scope — even when they appear after a return statement, where they can never be reached at runt

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
22 views

Related Articles

Why Colocation Might Matter More Than We Think
News

Why Colocation Might Matter More Than We Think

Medium Programming • 15h ago

Why std::mutex Beats Spinlocks (Even TTAS) Under Real Contention
News

Why std::mutex Beats Spinlocks (Even TTAS) Under Real Contention

Medium Programming • 15h ago

Qwen3.5-Omni: Vibe Coding Gets a New Twist! Write Code by Talking to Your Camera
News

Qwen3.5-Omni: Vibe Coding Gets a New Twist! Write Code by Talking to Your Camera

Medium Programming • 15h ago

Why users abandon your app mid-task
News

Why users abandon your app mid-task

Medium Programming • 15h ago

Litter-Robot Promo Codes and Deals: Up to $150 Off
News

Litter-Robot Promo Codes and Deals: Up to $150 Off

Wired • 16h ago

Discover More Articles