diff --git a/docs/src/pages/docs/javascript-anchor-types.md b/docs/src/pages/docs/javascript-anchor-types.md index ae45b0656a..ce3e632062 100644 --- a/docs/src/pages/docs/javascript-anchor-types.md +++ b/docs/src/pages/docs/javascript-anchor-types.md @@ -119,4 +119,21 @@ This reference shows you how Anchor maps Rust types to JavaScript/TypeScript typ .init([1, 2, 3]) .rpc(); ``` + +--- +* `Option` +* `T | null | undefined` +* ```javascript + // `null` for `None` + await program + .methods + .init(null) + .rpc(); + + // Non-nullish value for `Option` + await program + .methods + .init(42) + .rpc(); + ``` {% /table %}