We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcc69db commit 7b05602Copy full SHA for 7b05602
misc_docs/syntax/operator_ref_assignment.mdx
@@ -0,0 +1,26 @@
1
+---
2
+id: "ref-assignment"
3
+keywords: ["ref", "assign"]
4
+name: ":="
5
+summary: "This is the `ref assignment` operator."
6
+category: "operators"
7
8
+
9
+This operator is syntactic sugar for assigning to the `contents` value of a `ref`
10
11
+<CodeTab labels={["ReScript", "JS Output"]}>
12
13
+```res
14
+let total = ref(0)
15
+total := 1
16
+```
17
18
+```js
19
+var total = {
20
+ contents: 0
21
+};
22
23
+total.contents = 1;
24
25
26
+</CodeTab>
0 commit comments