See this previous question which boils down the same problem.
jmert
2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Closure strange behaviour | 1 | 459 | January 8, 2021 | |
| Strange behavior when defining a function inside an `if` | 2 | 345 | August 28, 2020 | |
| Same code in if and else blocks, get UndefVarError only on else condition | 3 | 914 | June 13, 2018 | |
| Weird behaviour with function variables leaking out of if blocks | 3 | 831 | December 6, 2021 | |
| Defining a function inside if...else..end NOT as expected? | 43 | 7618 | November 19, 2020 |