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.
12 lines
296 B
12 lines
296 B
/**
|
|
* 判断对象自身属性中是否具有指定的属性
|
|
*
|
|
* @param {Object} obj 对象
|
|
* @param {String/Number} key 键值
|
|
* @return {Boolean}
|
|
*/
|
|
function hasOwnProp (obj, key) {
|
|
return obj && obj.hasOwnProperty ? obj.hasOwnProperty(key) : false
|
|
}
|
|
|
|
module.exports = hasOwnProp
|
|
|