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 let rec recursive binding syntax.

Use let rec to define recursive functions.

Example

ReScriptJS Output
let rec factorial = n =>
  if n <= 1 {
    1
  } else {
    n * factorial(n - 1)
  }

References

  • Recursive Functions

© 2026 The ReScript Project

About
  • Community
  • ReScript Association
Find us on