Module Js.ArraySource

JavaScript Array API

Sourcetype 'a t = 'a array
Sourcetype 'a array_like
Sourceval from : 'a array_like -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval fromMap : 'a array_like -> f:('a -> 'b) -> 'b t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval isArray : 'a array -> bool
Sourceval length : 'a array -> int
Sourceval copyWithin : to_:int -> ?start:int -> ?end_:int -> 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval fill : value:'a -> ?start:int -> ?end_:int -> 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval pop : 'a t -> 'a option
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval push : value:'a -> 'a t -> int
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval pushMany : values:'a t -> 'a t -> int
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval reverseInPlace : 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval shift : 'a t -> 'a option
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval sortInPlace : 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval sortInPlaceWith : f:('a -> 'a -> int) -> 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval spliceInPlace : start:int -> remove:int -> add:'a t -> 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval removeFromInPlace : start:int -> 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval removeCountInPlace : start:int -> count:int -> 'a t -> 'a t
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval unshift : value:'a -> 'a t -> int
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval unshiftMany : values:'a t -> 'a t -> int
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval flat : 'a t t -> 'a t

flattens the given array of arrays one level deep. (ES2019)

Sourceval toReversed : 'a t -> 'a t

returns a new array with the elements in reversed order. (ES2023)

Sourceval toSorted : 'a t -> 'a t

the JS default comparator coerces elements to strings, which requires runtime type info. Use toSortedWith instead.

  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval toSortedWith : f:('a -> 'a -> int) -> 'a t -> 'a t

returns a new array with the elements sorted in ascending order. (ES2023)

Sourceval toSpliced : start:int -> remove:int -> add:'a t -> 'a t -> 'a t

returns a new array with some elements removed and/or replaced at a given index. (ES2023)

Sourceval removeFrom : start:int -> 'a t -> 'a t

returns a new array with elements removed starting at the start index. (ES2023)

Sourceval removeCount : start:int -> count:int -> 'a t -> 'a t

returns a new array with count elements removed starting at the start index. (ES2023)

Sourceval concat : other:'a t -> 'a t -> 'a t
Sourceval concatMany : arrays:'a t t -> 'a t -> 'a t
Sourceval includes : value:'a -> 'a t -> bool
Sourceval indexOf : value:'a -> ?start:int -> 'a t -> int
Sourceval join : ?sep:string -> string t -> string
Sourceval at : index:int -> 'a t -> 'a option

returns the element at the given index. Negative indices count back from the end of the array. (ES2022)

Sourceval lastIndexOf : value:'a -> 'a t -> int
Sourceval lastIndexOfFrom : value:'a -> start:int -> 'a t -> int
Sourceval slice : ?start:int -> ?end_:int -> 'a t -> 'a t
Sourceval copy : 'a array -> 'a array
Sourceval toString : 'a t -> string
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval toLocaleString : 'a t -> string
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval everyi : f:('a -> int -> bool) -> 'a t -> bool
Sourceval every : f:('a -> bool) -> 'a t -> bool
Sourceval filter : f:('a -> bool) -> 'a t -> 'a t
Sourceval filteri : f:('a -> int -> bool) -> 'a t -> 'a t
Sourceval findi : f:('a -> int -> bool) -> 'a t -> 'a option
Sourceval find : f:('a -> bool) -> 'a t -> 'a option
Sourceval findIndexi : f:('a -> int -> bool) -> 'a t -> int
Sourceval findIndex : f:('a -> bool) -> 'a t -> int
Sourceval findLast : f:('a -> bool) -> 'a t -> 'a option
Sourceval findLasti : f:('a -> int -> bool) -> 'a t -> 'a option
Sourceval findLastIndex : f:('a -> bool) -> 'a t -> int
Sourceval findLastIndexi : f:('a -> int -> bool) -> 'a t -> int
Sourceval entries : 'a t -> (int * 'a) Js__.Js_iterator.t
Sourceval keys : 'a t -> int Js__.Js_iterator.t
Sourceval values : 'a t -> 'a Js__.Js_iterator.t
Sourceval forEach : f:('a -> unit) -> 'a t -> unit
Sourceval forEachi : f:('a -> int -> unit) -> 'a t -> unit
Sourceval map : f:('a -> 'b) -> 'a t -> 'b t
Sourceval mapi : f:('a -> int -> 'b) -> 'a t -> 'b t
Sourceval reduce : f:('b -> 'a -> 'b) -> init:'b -> 'a t -> 'b
Sourceval reducei : f:('b -> 'a -> int -> 'b) -> init:'b -> 'a t -> 'b
Sourceval reduceRight : f:('b -> 'a -> 'b) -> init:'b -> 'a t -> 'b
Sourceval reduceRighti : f:('b -> 'a -> int -> 'b) -> init:'b -> 'a t -> 'b
Sourceval some : f:('a -> bool) -> 'a t -> bool
Sourceval somei : f:('a -> int -> bool) -> 'a t -> bool
Sourceval unsafe_get : 'a array -> int -> 'a
Sourceval unsafe_set : 'a array -> int -> 'a -> unit