You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
286 B
11 lines
286 B
|
3 years ago
|
/**
|
||
|
|
* @description: 判断是否是此对象上的实例属性
|
||
|
|
* @param {object} obj
|
||
|
|
* @param {string} prop
|
||
|
|
* @return {boolean}
|
||
|
|
* @example hasOwnProp({a:1},'a') // true
|
||
|
|
*/
|
||
|
|
export default function hasOwnProp(obj, prop) {
|
||
|
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
||
|
|
}
|