Search⌘ K

Solution Review: Mutable Integers

Explore how to work with mutable integers in ReasonML by using the := operator to assign new values and the ^ operator to access original values within wrappers. Learn how these concepts apply to identifiers and mutable data in the language.

We'll cover the following...

Solution

Reason
let x = ref(20);
let y = ref(3);
x := x^ + 5;
y := y^ * 10;
Js.log(x^);
Js.log(y^);

Explanation

...