The Wayback Machine - http://web.archive.org/web/20201018034633/https://github.com/InterviewMap/CS-Interview-Knowledge-Map/issues/167
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

对象转基本类型是不是有问题? #167

Open
liuyh0805 opened this issue Nov 25, 2018 · 0 comments
Open

对象转基本类型是不是有问题? #167

liuyh0805 opened this issue Nov 25, 2018 · 0 comments

Comments

@liuyh0805
Copy link

@liuyh0805 liuyh0805 commented Nov 25, 2018

文中描述对象转基本类型是首先会调用 valueOf 然后调用 toString。
转换成数字是这个顺序,转换成字符串时先调用toString,后调用valueOf方法。

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.