hyTags
HomeHome DocumentationDocumentation

loop-is-first

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