require

If value is not null, return its contents. If value is null, set it to defaultValue and return it. Similar to object.require for associative arrays, and Rust's Option::get_or_insert.

ref
T
require
(
T
)
(
ref Nullable!T value
,)

Examples

t
{
	Nullable!int i;
	assert(i.require(3) == 3);
	assert(i.require(4) == 3

Meta