Why console.log(1 + ‘1’ – 1); is 10 in JavaScript?
JavaScript is a dynamic, loosely typed language, which means it automatically converts between data types in certain situations. This automatic conversion, called type coercion, can sometimes lead to unexpected results. In this blog post, we’ll break down the expression console.log(1 + ‘1’ – 1) and explain what’s happening under the hood. 1. What Happens When […]
