confused what "0" and "1" is doing behind the scene.
if(13 % 2 !== 0) {
alert ("Your age is odd!"); }
and
if(13% 2 !== 1) {
alert (""); }
confused what "0" and "1" is doing behind the scene.
if(13 % 2 !== 0) {
alert ("Your age is odd!"); }
and
if(13% 2 !== 1) {
alert (""); }
value % 2 will give if the rest of a division by 2, with even numbers this is zero.
for ex. 4 / 2 = 2 rest 0 5 / 2 = 2 rest 1
so if the age is > 5 this both will work ok. But with = 5 and similar ages with a rest of 1 this should fail.