+ 3

Why the output not “9solo215”? Can anyone explain pls

var x= 2+7+"solo"; var y="2"+ 6+9; alert(x+y); Output: “9solo269”

15th Apr 2018, 9:49 PM
🄼🄼🄷🄺
🄼🄼🄷🄺 - avatar
2 ответов
+ 18
1. "2" + 6 ="26" 2. "26" + 9 = "269" If you want to get “9solo215” try this: var x= 2+7+"solo"; var y="2"+ (6+9) ; alert(x+y);
15th Apr 2018, 9:55 PM
Igor Makarsky
Igor Makarsky - avatar
+ 1
Thanks, that was really silly
15th Apr 2018, 9:56 PM
🄼🄼🄷🄺
🄼🄼🄷🄺 - avatar