hyTags
HomeHome DocumentationDocumentation

array-remove-last

Creates a new array with the last `length` elements removed.
Parameter
Type
Description
self
[T]
Initial array
length
Number?
Number of elements to remove from end (defaults to 1)
return
[T]
New array with last `length` elements removed
Test Case:Remove last element
    <div></div>
    
    <array-new type="string">
    <array-append value="a">
    <array-append value="b">
    <array-append value="c">
    <array-remove-last>
    <array-join separator=",">
    <assert-equal value="a,b" type="string">
    
    👆 Try to change something!
  • Test succeeded Test failed