Because Flat is a global object, thus storing unnecessary results from previous function calls.
Flat
This comment is hidden because it contains spoiler information about the solution
I don't follow, how does the end parentheses make it private?
I too not recommended using eval.. I think this kata trying learn us work on state machine.
Using eval would not be recommended if you can't control the input (For example 'user input' -> could be executed as code) This is a Kata though, not a function that would run after some user input on an actual application.
Loading collection data...
Because
Flat
is a global object, thus storing unnecessary results from previous function calls.This comment is hidden because it contains spoiler information about the solution
I don't follow, how does the end parentheses make it private?
I too not recommended using eval.. I think this kata trying learn us work on state machine.
Using eval would not be recommended if you can't control the input (For example 'user input' -> could be executed as code)
This is a Kata though, not a function that would run after some user input on an actual application.