hasProperty method

bool hasProperty(
  1. Object property
)

Returns true if the JavaScript object contains the specified property either directly or though its prototype chain.

This is the equivalent of the in operator in JavaScript.

Implementation

bool hasProperty(Object property) {
  if (property is! String && property is! num) {
    throw ArgumentError('property is not a String or num');
  }
  throw UnsupportedError(
      'JavaScript interop is not supported in this runtime.');
}