Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
797 views
in Technique[技术] by (71.8m points)

if-else语句一起执行过程中else未执行

image
如图代码,选中一起执行,第一次执行时只运行了if部分,未执行else部分.
重新执行一次,就都执行了,什么原因?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

第一次执行时只运行了if部分,说明表quote存在,然后在if语句内把它删除了。
第二次执行时,表被删除了,即不存在了,所以进入else分支。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...