sebinspace@lemmy.world to Lemmy Be Wholesome@lemmy.world · 9 months agoTELL MElemmy.worldimagemessage-square337fedilinkarrow-up1478arrow-down141file-text
arrow-up1437arrow-down1imageTELL MElemmy.worldsebinspace@lemmy.world to Lemmy Be Wholesome@lemmy.world · 9 months agomessage-square337fedilinkfile-text
minus-squarefsxylo@sh.itjust.workslinkfedilinkEnglisharrow-up2·9 months agoSo there is the “it depends” answer, but generally: NULL means a value doesn’t exist in memory, usually because the variable was never given a value, or because the variable was given the null value. “NULL” is a string with the word null written in all caps. It’s not an empty string and it’s not NULL. It’s a value with the word “NULL”. “” is an empty string. It’s not NULL because technically it’s fully initialized value. It’s a string that has a length of 0 characters. NaN is not a number. A value could or could not exist, but if it’s not a number then if you check for a number you could get NaN.
So there is the “it depends” answer, but generally:
NULL means a value doesn’t exist in memory, usually because the variable was never given a value, or because the variable was given the null value.
“NULL” is a string with the word null written in all caps. It’s not an empty string and it’s not NULL. It’s a value with the word “NULL”.
“” is an empty string. It’s not NULL because technically it’s fully initialized value. It’s a string that has a length of 0 characters.
NaN is not a number. A value could or could not exist, but if it’s not a number then if you check for a number you could get NaN.