Converts a nullable value to an Option. If the value is null or undefined, returns None. Otherwise, returns Some(value).
Option
null
undefined
None
Some(value)
The value to convert
An Option representing the nullable value
Converts a nullable value to an
Option
. If the value isnull
orundefined
, returnsNone
. Otherwise, returnsSome(value)
.