+ 1
What will be alerted??
var a='7'; var b='9'; alert(a+b %7); //Answer is 72 Does anyone know how the answer came about?
1 Odpowiedź
+ 5
Because
b='9';
b%7='9'%7=2 (type of number)
a='7';
a+b%7 (b%7= 2)
'7'+2= ' 72' (type of string)
//type of your output is string