toString method Null safety

String toString()

Print out a String representation of this Node.

Implementation

String toString() {
  String? value = nodeValue; // Fetch DOM Node property once.
  return value == null ? super.toString() : value;
}