Returns the optional optA if it contains a value, otherwise returns optB. The order of arguments is reversed because of that it is useful for partial applying.
optA
optB
The fallback optional.
optA or optB.
expect(or(none())(none())).toStrictEqual(none());expect(or(none())(some(2))).toStrictEqual(some(2));expect(or(some(100))(none())).toStrictEqual(some(100));expect(or(some(100))(some(2))).toStrictEqual(some(2)); Copy
expect(or(none())(none())).toStrictEqual(none());expect(or(none())(some(2))).toStrictEqual(some(2));expect(or(some(100))(none())).toStrictEqual(some(100));expect(or(some(100))(some(2))).toStrictEqual(some(2));
Returns the optional
optAif it contains a value, otherwise returnsoptB. The order of arguments is reversed because of that it is useful for partial applying.