+ 2

What do you do with this? Var x=50; if (x>42){ document.write(x%10)} document.write(42)

Can someone kindly explain this☝☝to me

22nd May 2017, 10:11 PM
Raz
Raz - avatar
4 Antworten
+ 1
x =50. if x>42(true)=> we write in our document remainder after devusion 50/10 =>remainder 0. write 0 in document. then we just write in document 42 so result should be 042 I hope it's not real challenge,cause people shouldn't use document.write method...
22nd May 2017, 10:22 PM
Rose Sevenyears
Rose  Sevenyears - avatar
+ 3
Please take that code, put it in a new playground file and then put the link to the code in the description. It's always easier to answer when you can access the code directly.(:
22nd May 2017, 10:17 PM
Tim G
Tim G - avatar
+ 2
thank you @Rose and i was the one confused and write document.type instead of write
22nd May 2017, 10:26 PM
Raz
Raz - avatar
0
oky
22nd May 2017, 10:20 PM
Raz
Raz - avatar