Checks if an object has a property. - Node.js Object

Node.js examples for Object:Property

Description

Checks if an object has a property.

Demo Code


export function has(obj, propName) {
  return Object.prototype.hasOwnProperty.call(obj, propName)
}

Related Tutorials