hyTags
HomeHome DocumentationDocumentation

array-insert

Creates a new array with `value` inserted at the specified index.
Parameter
Type
Description
self
[T]
Initial array
index
Number
Index at which to insert the value
value
T
Value to insert
return
[T]
New array with `value` inserted at index
Test Case:Insert at index
    <div></div>
    
    <array-new type="string">
    <array-append value="a">
    <array-append value="c">
    <array-insert index="1" value="b">
    <array-join separator=",">
    <assert-equal value="a,b,c" type="string">
    
    👆 Try to change something!
  • Test succeeded Test failed