Syntax Lookup

Enter some language construct you want to know more about.
This is the while loop.

ReScript supports while loops. While loops execute its body code block while its condition is true.

ReScript does not have the break keyword, but you can easily break out of a while loop by using a mutable binding.

Example

ReScriptJS Output
let break = ref(false)

while !break.contents {
  if Math.random() > 0.3 {
    break := true
  } else {
    Console.log("Still running")
  }
}

References