Skip to content

hasOwn

描述

检查对象是否拥有某个属性。

示例

ts
import { hasOwn } from '@base-web-kits/base-tools-vue';

const obj = { a: 1 };
if (hasOwn(obj, 'a')) {
  console.log('has own property a');
}
```来源

[VueUse](https://vueuse.org/functions/hasOwn/)