how to handle 0 and null value in java script
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2017
02:46 PM
08-14-2017
02:46 PM
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
}
}
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2017
11:59 PM
08-14-2017
11:59 PM
You can use schDay1 === null
= = = evaluate type as well.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2017
06:26 AM
08-15-2017
06:26 AM
It does work!!! Thank you so much!
