Skip to content

Problem of scoping in loops #30

@d-p-dev

Description

@d-p-dev

In an each loop, the scoping of variables is not really handled. If a variable is declared in one iteration of the loop, it's value is kept in the following iterations

In the following example, the variable newVariable will be set to test from the beginning until the end of the loop iteration

- var array = [1,2,3,4]
each value, index in array
  if index === 0
    - var newVariable = 'test'

Is this a known issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions