Gets a value indicating whether the target object has the provided metadata key defined.
@param metadataKey A key used to store and retrieve metadata.
@param target The target object on which the metadata is defined.
@param propertyKey (Optional) The property key for the target.
@returns `true` if the metadata key was defined on the target object; otherwise, `false`.
@example

class Example {
// property declarations are not part of ES6, though they are valid in TypeScript:
// static staticProperty;
// property;

constructor(p) { }
static staticMethod(p) { }
method(p) { }
}

// constructor
result = Reflect.hasOwnMetadata("custom:annotation", Example);

// property (on constructor)
result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");

// property (on prototype)
result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");

// method (on constructor)
result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");

// method (on prototype)
result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
function hasOwnMetadata(metadataKey, target, propertyKey) {
            if (!IsObject(target))
                throw new TypeError();
            if (!IsUndefined(propertyKey))
                propertyKey = ToPropertyKey(propertyKey);
            return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
        }