# 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: instead of:

- URL: https://graffino.com/til/safely-use-objectprototypes-builtins-in-javascript
- Author: Nick Ciolpan
- Channel: javascript
- Published: 2021-12-10
- Updated: 2022-04-27

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");
```
