Syntax Lookup

Enter some language construct you want to know more about.
Optional record fields can be omitted when creating records.

Use ? on a record field to mark it optional.

Example

ReScriptJS Output
type user = {
  age: int,
  name?: string,
}

let withName: user = {age: 5, name: "Ada"}
let withoutName: user = {age: 7}

References