0
Why this happpen? Is it a rule in JS?
let a = "+6"; alert(a); // +6 alert(+a); // 6 https://code.sololearn.com/WD2YN22TzBcT/?ref=app
1 Answer
+ 3
As a string, a is just a text "+6", so that's why it shows the plus sign. +a is a number, and numbers don't show the plus sign, so there will be no plus sign