Skip to content

Commit 6033816

Browse files
Review
1 parent e06a800 commit 6033816

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

packages/@rescript/runtime/Stdlib_TypedArray.res

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
type t<'a>
33

44
/**
5-
`get(typedArray, index)` returns the element at `index` wrapped in `Some`, or `None` when the position is out of bounds.
5+
`get(typedArray, index)` returns the element at `index` of `typedArray`.
6+
Returns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.
67
78
See [`TypedArray.prototype.at`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/at) on MDN.
89
@@ -18,7 +19,9 @@ TypedArray.get(view, 10) == None
1819
external get: (t<'a>, int) => option<'a> = ""
1920

2021
/**
21-
`set(typedArray, index, value)` writes `value` at `index` in place.
22+
`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.
23+
24+
Beware this will *mutate* the array.
2225
2326
See [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.
2427

0 commit comments

Comments
 (0)