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
The Type Coercion Puzzle That Makes JavaScript Look Weird
How-ToWeb Development

The Type Coercion Puzzle That Makes JavaScript Look Weird

via Dev.to JavaScriptEbenezer3w ago

Yesterday we looked at a small JavaScript puzzle involving the mysterious this keyword. JavaScript Interview Puzzle #2 we explored small small pieces of code that looked innocent but behaved in surprising ways. The goal of these puzzles is not to memorize tricks.The goal is to slowly understand how JavaScript actually thinks. Today’s puzzle is one of the most famous JavaScript interview questions. It looks so simple that many developers answer it confidently. And then… JavaScript does something unexpected. Let’s see if you can predict it. The Puzzle Look carefully at the following code. Before scrolling down, try to guess the output. console.log("5" + 3); console.log("5" - 3); console.log(true + true); console.log(false + 5); Take a moment. What do you think JavaScript will print? Many beginners assume the outputs should be something like this: 8 2 2 5 But that is only partially correct . The real output is: 53 2 2 5 Wait. Why did the first one become 53 instead of 8 ? Did JavaScript f

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
10 views

Related Articles

How-To

The most important 40 mcq with its answers How to use Android visual studio to make a mobile app

Medium Programming • 1d ago

What is Agent Script? How to Build Agents with It in Agentforce
How-To

What is Agent Script? How to Build Agents with It in Agentforce

Medium Programming • 1d ago

I Coded 3 Famous Trading Strategies in Pine Script and Backtested All of Them. None Passed.
How-To

I Coded 3 Famous Trading Strategies in Pine Script and Backtested All of Them. None Passed.

Medium Programming • 1d ago

Belkin’s battery-equipped Switch 2 case is more than 35 percent off right now
How-To

Belkin’s battery-equipped Switch 2 case is more than 35 percent off right now

The Verge • 1d ago

Why this Marshall is the first soundbar I've tested that truly challenges my Sonos Arc Ultra
How-To

Why this Marshall is the first soundbar I've tested that truly challenges my Sonos Arc Ultra

ZDNet • 1d ago

Discover More Articles