Making Sense of 'No Shadowed Variable' tslint Warning

后端 未结 7 1563
隐瞒了意图╮
隐瞒了意图╮ 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:46

    You are re-declaring the same variable const nextStageStep in each if block.

    Juste replace const nextStageStep = 'step 2'; with nextStageStep = 'step 2'; (and all the other if cases) and it'll be all right.

提交回复
热议问题