#how do i check if a variable is undefined/null?

1 messages · Page 1 of 1 (latest)

odd wharf
#
  1. cant check for undefined 2. compare against null if the value is an optional (?T)
#

if you just have T, you cant (what would a null T thats not an optional mean?)

#

what is uninit data?

timid cosmos
#

yes, it's poison, you must initilaise it before use.

#

undefined is for cases where you have external knowledge of whether some variable is initialised, null is for the cases where you don't

#

in the case of an fresh allocation, you know the data there is uninitialised and so it's filled with undefined