FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
til/javascript/conversion-algorithm.md.md at main · mopig/til · GitHub
mopig
/
til
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
til
/
javascript
/
conversion-algorithm.md.md
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (10 loc) · 429 Bytes
Breadcrumbs
til
/
javascript
/
conversion-algorithm.md.md
Copy path
File metadata and controls
14 lines (10 loc) · 429 Bytes
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions
关于 JS 的类型转换
hint 类型及触发条件
string - alert 以及其他需要 string 的操作
number - math 相关操作
default - 其他少数的操作,如==
转换算法
优先执行 obj[Symbol.toPrimitive](hint)
Symbol.toPrimitive 不存在
hint 为 string 执行顺序:toString valueOf
hint 为 number or default 执行顺序:valueOf toString
Back
|
FazBrowse Home
|
New Git URL