You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@send external indexOfFrom: (array<'a>, 'a, int) => int = "indexOf"
399
399
400
+
/**
401
+
`join(array, ~separator=?)` produces a string where all items of `array` are printed, separated by `separator`. If no separator is specified, `,` is used as the default. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.
402
+
403
+
See [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)
404
+
405
+
## Examples
406
+
```rescript
407
+
let array = ["One", "Two", "Three"]
408
+
409
+
Console.log(array->Array.join) // One,Two,Three
410
+
411
+
Console.log(array->Array.join(~separator=" -- ")) // One -- Two -- Three
`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.
402
419
@@ -407,9 +424,27 @@ let array = ["One", "Two", "Three"]
407
424
Console.log(array->Array.joinWith(" -- ")) // One -- Two -- Three
`joinUnsafe(array, ~separator=?)` produces a string where all items of `array` are printed, separated by `separator`. If no separator is specified, `,` is used as the default. Under the hood this will run JavaScript's `toString` on all the array items.
433
+
434
+
See [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)
`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.
0 commit comments