hyTags
HomeHome DocumentationDocumentation

loop-is-last

Checks if the current iteration is the last iteration of the loop.
Parameter
Type
Description
return
bool
True if this is the last iteration, false otherwise.
Test Case:Is last in array loop
    <div></div>
    
    <string-split self="ab">
    <var-set name="lastCount" type="number">
      <number-new value="0">
    </var-set>
    <array-loop>
      <loop-is-last>
      <if-true>
        <var-update name="lastCount">
          <number-add value="1">
        </var-update>
      </if-true>
    </array-loop>
    <var-get name="lastCount">
    <assert-equal value="1" type="number">
    
    👆 Try to change something!
  • Test succeeded Test failed