Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript 问题 #168

Closed
GuiYe18 opened this issue Apr 18, 2020 · 4 comments
Closed

JavaScript 问题 #168

GuiYe18 opened this issue Apr 18, 2020 · 4 comments

Comments

@GuiYe18
Copy link

GuiYe18 commented Apr 18, 2020

for (var i = 0; i < 3; i++) {
  var i = 'abc';
  console.log(i);
}
// abc

这里为什么会只输出一个abc呢??求教

上面不是有人已经说过了吗,i = abc ,然后再++ 转化成 NaN ,小于 3

我也是这样想的,但是当执行"abc"++的时候,会报错的啊,并不能得出NaN

Originally posted by @ZhangDaZongWei in #82 (comment)

@jack-pearson
Copy link

var a = "abc"
a++
console.log(a) // NaN

@codejarrown
Copy link

codejarrown commented Apr 22, 2020 via email

@mqyqingfeng mqyqingfeng changed the title > > > ```js JavaScript 问题 Apr 22, 2020
@mqyqingfeng
Copy link
Owner

@reconsole 是这样的,不用新建一个 issue 的形式来讨论这个问题,可以直接在对应 issue 里评论回复的。 博客的 watch 相当于订阅,如果有回复或者新的 issue ,会邮件通知所有 watch 的同学,所以呢,你取消自己的 watch 是没有什么用的……不过这件事情也没有什么太大关系哈,不用介意,下次直接评论回复好了,如果真的需要新建 issue,至少 issue 的标题要写清楚~

@codejarrown
Copy link

codejarrown commented Apr 22, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants