Skip to main content
July 19, 2022
Question

Foreach decrementation

  • July 19, 2022
  • 2 replies
  • 0 views

how to print fv!index in reverse order in foreach loop.

E.g 5,4,3,2,1

    2 replies

    mikes0011
    Brainy
    July 19, 2022

    Since you didn't specify any use case or requirements, I've gone with the laziest approach I can think of to accomplish this programatically:

    reverse(a!forEach(enumerate(5), fv!index))

    The Expression Guru
    harshitb6843
    July 19, 2022

    Another approach to this except what Mike mentioned can be - 

    a!forEach(
      items: enumerate(5),
      expression: 5-fv!item
    )

    There can be endless ways of achieving a solution to a problem. But if you specify your use case and explain the problem better, you might find the most accurate ways.