What will be alerted?? | Sololearn: Learn to code for FREE!


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?

2/22/2021 4:19:12 AM

S.P. Karthee

1 Answer

New Answer


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