get method

JSAny? get(
  1. Node node
)

Returns the value of this local on the specified node.

selection.each((Element thisArg, JSAny? d, int i, List<Element?> nodes) {
  final value = foo.get(thisArg);
});

If the node does not define this local, returns the value from the nearest ancestor that defines it. Returns null if no ancestor defines his local.

Implementation

JSAny? get(Node node) {
  var id = _;
  Node? node0 = node;
  while (!(node0 as JSObject).hasProperty(id.toJS).toDart) {
    if ((node0 = node.parentNode) == null) {
      return null;
    }
  }
  return (node0 as JSObject)[id];
}