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

js中的一些简洁写法 #42

Open
lovelmh13 opened this issue Jul 19, 2020 · 0 comments
Open

js中的一些简洁写法 #42

lovelmh13 opened this issue Jul 19, 2020 · 0 comments

Comments

@lovelmh13
Copy link
Owner

  1. 有.x属性,并且返回.x的值

出自 node Buffer.from源码

const valueOf = value.valueOf && value.valueOf() // 有value属性,并且返回.value()的值
if (valueOf !== null && valueOf !== undefined && valueOf !== value)
  return Buffer.from(valueOf, encodingOrOffset, length)
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

1 participant