Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Tree Walker- My Solution

129 views
Skip to first unread message

Yarden Ezra

unread,
Jan 8, 2020, 4:42:57 AM1/8/20
to Intro to JavaScript

nextNode = function(node) {
  if(node.firstChild) return node.firstChild;
  while(!node.nextSibling && node.parentNode)
    node=node.parentNode;
  return node.nextSibling;
};
Reply all
Reply to author
Forward
0 new messages