Why are the following results different using JavaScript?
console.log(1 + + "2"); // => 3
console.log(1 + "2"); // => 12
Is there an implicit conversion in JavaScript?
No, the unary plus operator (the second +) explicitely converts a string to a number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With