The Dangers of the ‘+’ Operator in JavaScript

How simple addition can misfire and break JavaScript applications in ways you might not expect

Chris Geelhoed
Better Programming
Published in
4 min readJan 13, 2020

--

Photo by Kevin Jarrett on Unsplash

Like most programming languages, JavaScript has a + operator that can be used to perform addition. Unlike other programming languages, however, the operator also serves a second purpose: string formatting.

--

--