We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hasOwnPropery
in
var data = { name: 'leslie', compony: 'xxxx' } // hasOwnProperty 方法不会去判断原型 console.info(data.hasOwnProperty("name")) // true console.info(data.hasOwnProperty("hasOwnProperty")) // false // in 方法会去判断原型 console.info('name' in data) // true console.info('hasOwnProperty' in data) // true // getOwnPropertyNames console.info(Object.getOwnPropertyNames(data)) // ['name','company'] // keys console.info(Object.keys(data)) // ['name','company']
The text was updated successfully, but these errors were encountered:
No branches or pull requests
hasOwnPropery
: 不会去判断原型变量和方法in
: 会去判断原型变量和方法The text was updated successfully, but these errors were encountered: