1-liners
Version:
Useful oneliners and shorthand functions
24 lines (21 loc) • 562 B
JavaScript
/**
* @module 1-liners/hasOwnProperty
*
* @description
*
* Same as [`obj.hasOwnProperty(prop)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty).
*
* @example
*
* const hasOwnProperty = require('1-liners/hasOwnProperty');
*
* hasOwnProperty('a', {a: 1, b: 2}); // => true
* hasOwnProperty('c', {a: 1, b: 2}); // => false
*
*/
;
exports.__esModule = true;
exports["default"] = function (prop, obj) {
return obj.hasOwnProperty(prop);
};
module.exports = exports["default"];