ReScript HomeReScript Home
DocsPlaygroundBlogCommunityPackages
  • Playground
  • Blog
  • Community
  • Packages
  • X
  • Bluesky
  • GitHub
  • Forum
Language ManualAPISyntax LookupReact

Syntax Lookup

Enter some language construct you want to know more about.
This is the ternary expression syntax.

Use condition ? whenTrue : whenFalse as a concise conditional expression.

Example

ReScriptJS Output
let isAdmin = true
let greeting = isAdmin ? "Welcome, admin" : "Welcome, user"

References

  • If-Else & Ternary

© 2026 The ReScript Project

About
  • Community
  • ReScript Association
Find us on