CSL
8 years agoContributor
how to handle 0 and null value in java script
Hello,
I am having some issues handling 0 and null values in javascript. I want them to be handled differently, 0 is always handled the same as null. The code below returns True.
ex.
function main()
{
schDay1 = 0
if ((schDay1 == null) || (schDay1 =="" ))
//Set it to next day
schDay = 1;
else
{
schDay = schDay1
}
}
You can use schDay1 === null
= = = evaluate type as well.