operator [] method

Object? operator [](
  1. Object property
)

Returns the value associated with property from the proxied JavaScript object.

The type of property must be either String or num.

Implementation

Object? operator [](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.');
}