Sample usage is HTML tree, where every child node is named according to its type.
class Node extends Array
{
constructor(type = 'InputElement', children = [])
{
super(...children);
this.type = type;
}
[Symbol.toStringTag]()
{
return this.type;
}
}
Example of print to console:
HTMLElement [
HeadElement [
....
]
BodyElement [
....
]
]
(edited by @vsemozhetbyt: added backticks for code blocks)
Sample usage is HTML tree, where every child node is named according to its type.
Example of print to console:
(edited by @vsemozhetbyt: added backticks for code blocks)