Skip to content

2.3 数值 一章 中 5.2 parseFloat 一节 的错误 #246

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

Closed
yuu2lee4 opened this issue Jun 4, 2022 · 1 comment
Closed

2.3 数值 一章 中 5.2 parseFloat 一节 的错误 #246

yuu2lee4 opened this issue Jun 4, 2022 · 1 comment

Comments

@yuu2lee4
Copy link
Contributor

yuu2lee4 commented Jun 4, 2022

该节中有以下描述错误:
如果参数不是字符串,或者字符串的第一个字符不能转化为浮点数,则返回NaN

这里应该行为跟parseInt一样,参数不是字符串,会先隐式转换为字符串,所以parseFloat([123]) 不会返回NaN

@ruanyf
Copy link
Contributor

ruanyf commented Jun 7, 2022

谢谢提交,已经合并了。

@ruanyf ruanyf closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants