Code one:
obj.hasOwnProperty(prop);
Code Two:
const hasOwnProperty = Object.prototype;
hasOwnProperty.call(obj, prop);
I always use the first coding style, but I saw several times about the second coding style in some JS books or github projects. I want to know it's just a habit or really a better way to write my js code. Thanks.