0

What is the output?Why?

let num = "8"+2+3; console.log(typeof num,num);

22nd Apr 2020, 6:00 PM
Nay Win Hlaing
Nay Win Hlaing - avatar
1 Answer
+ 2
When you add numbers to a string, the numbers get converted to a string as well. That's why the output become 823 instead of 13 and the type of it becomes string. If I couldn't clear your doubt, please ask me again.
22nd Apr 2020, 6:11 PM
Sajid
Sajid - avatar