If the new and old nodes are of different types. This could be either of the cases below:
one of the node is a TextNode while the other one is an ElementNode
Both are ElementNode but with different tag.
In fact, all my base cases are defined in a guard clause. This means that all the return statement before the last return can be considered as base case.
Oops, I just realised there is one more, which is when there is no children in the node. But I didn't explicitly deal with that case as it will be automatically dealt with in the for loop in diffChildren
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am sorry that my explanation didn't help. :(
diffhas two base cases:undefinedIn fact, all my base cases are defined in a guard clause. This means that all the return statement before the last return can be considered as base case.
Oops, I just realised there is one more, which is when there is no children in the node. But I didn't explicitly deal with that case as it will be automatically dealt with in the for loop in
diffChildren