js string minus number
snippet in javascript

js string minus number

user1932

console.log(10+"1"); //101
console.log(10-"1"); //9

js string minus number

user4628

console.log(10+"1"); //101   both will be string
console.log(10-"1"); //9     string will be taken as number