Type-narrowing predicate: returns true when the result is Ok.
true
Ok
if (isOk(r)) { console.log(r.value); // narrowed to Ok branch} Copy
if (isOk(r)) { console.log(r.value); // narrowed to Ok branch}
Type-narrowing predicate: returns
truewhen the result isOk.