Skip to content

Instantly share code, notes, and snippets.

View ztl8702's full-sized avatar
💭
I may be slow to respond.

Radium Zheng ztl8702

💭
I may be slow to respond.
View GitHub Profile
class Node {
constructor(state, node) {
if (arguments.length === 1) {
this.state = state;
this.parent;
this.childArray = [];
} else if (arguments.length === 2) {
this.state = new State(null, node.state);
if (node.parent !== (null || undefined)) {
this.parent = node.parent;