Null object: Difference between revisions

Added R code
(Added R code)
Line 304:
x is None
</pre>
 
=={{header|R}}==
R has the special value NULL to represent a null object. You can test for it using the function is.null. Note that R also has a special value NA to represent missing or unknown values.
<lang R>
is.null(NULL) # TRUE
is.null(123) # FALSE
is.null(NA) # FALSE
123==NULL # Empty logical value, with a warning
foo <- function(){} # function that does nothing
foo() # returns NULL
</lang>
 
=={{header|Ruby}}==