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

About this code:Object.prototype.toString.call(obj) #9

Closed
nanyang24 opened this issue Apr 25, 2019 · 3 comments
Closed

About this code:Object.prototype.toString.call(obj) #9

nanyang24 opened this issue Apr 25, 2019 · 3 comments

Comments

@nanyang24
Copy link
Contributor

nanyang24 commented Apr 25, 2019

I have a question about this line of code

https://github.com/alex-cory/use-http/blob/7715b206a1790ad2d44e311e1e3fb13a5dfc02b4/src/useFetch.js#L4

Why not write it like this:

 const isObject = obj => Object.prototype.toString.call(obj) === '[object Object]' 

I think you must have a special consideration, so Im very curious.
Could you tell me what your thought if you have time.
THX~

@alex-cory
Copy link
Collaborator

Actually that's just a typo LOL nice catch :)

@alex-cory
Copy link
Collaborator

Do you wanna do a PR? :) Otherwise I can do it

@nanyang24
Copy link
Contributor Author

@alex-cory
😃 No problem~
I'll create a PR this afternoon(🇨🇳time zone)

This issue was closed.
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