+ 1

Why output is 1 ? Please explain.

alert(false/true+true);

19th May 2019, 6:44 AM
Umesh Kushwaha
Umesh Kushwaha - avatar
4 Antworten
+ 6
Answer False=0; True =1; So, 0/1 +1=0+1=1
19th May 2019, 6:53 AM
Muhammad Rashid
Muhammad Rashid - avatar
+ 5
My pleasure. We are here to Help 😊
19th May 2019, 7:55 AM
Muhammad Rashid
Muhammad Rashid - avatar
+ 2
Thanks.
19th May 2019, 7:54 AM
Umesh Kushwaha
Umesh Kushwaha - avatar
+ 1
false/true = 0/1 = 0 0 + true = 0 + 1 = 1
19th May 2019, 6:50 AM
Théophile
Théophile - avatar