Safely use Object.prototypes builtins in JavaScript

To avoid the situation in which you can make a wrong assumption about an object having prototype builtins use:
```
const hasBarProperty = Object.prototype.hasOwnProperty.call(foo, "bar");
```
instead of:
```
const hasBarProperty = foo.hasOwnProperty("bar");
```

Nick Ciolpan
10 Dec 2021
« Back to post