[guide] add Object.hasOwn

This commit is contained in:
Mustafa UZUN
2022-11-17 20:15:09 +03:00
committed by Jordan Harband
parent 4ef69edc63
commit 81157eec23

View File

@@ -311,6 +311,8 @@ Other Style Guides
/* or */
import has from 'has'; // https://www.npmjs.com/package/has
console.log(has(object, key));
/* or */
console.log(Object.hasOwn(object, key)); // https://www.npmjs.com/package/object.hasown
```
<a name="objects--rest-spread"></a>