mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-12 22:48:12 -05:00
[guide] Fix npm package has usage example
This commit is contained in:
@@ -298,10 +298,10 @@ Other Style Guides
|
||||
|
||||
// best
|
||||
const has = Object.prototype.hasOwnProperty; // cache the lookup once, in module scope.
|
||||
console.log(has.call(object, key));
|
||||
/* or */
|
||||
import has from 'has'; // https://www.npmjs.com/package/has
|
||||
// ...
|
||||
console.log(has.call(object, key));
|
||||
console.log(has(object, key));
|
||||
```
|
||||
|
||||
<a name="objects--rest-spread"></a>
|
||||
|
||||
Reference in New Issue
Block a user