Making Sense of 'No Shadowed Variable' tslint Warning

后端 未结 7 1559
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 09:58

I have a function that checks for the current stage in a sequential stream, based on a particular discipline that is passed in, and, according to that value, assigns the nex

7条回答
  •  春和景丽
    2020-12-10 10:49

    In general this error occurs When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers

    Refer to this article for code samples explaining this.

提交回复
热议问题