hyTags
HomeHome DocumentationDocumentation

array-select

Creates a new array containing only elements for which the commands return true.
Parameter
Type
Description
self
[T]
Array to filter
commands
Commands
Commands that return boolean to test each element
return
[T]
New array with filtered elements
Test Case:Select non-empty strings
    <div></div>
    
    <array-new type="string">
    <array-append value="a">
    <array-append value>
    <array-append value="b">
    <array-select>
      <string-is-empty>
      <bool-not>
    </array-select>
    <array-join separator=",">
    <assert-equal value="a,b" type="string">
    
    👆 Try to change something!
  • Test succeeded Test failed