function collect(node) {
    var index = -1

    if ('length' in node) {
      while (++index < node.length) {
        collectOne(node[index])
      }
    } else {
      collectOne(node)
    }
  }
/* Append nodes to array, filtering out duplicates. */
Append nodes to array, filtering out duplicates.
Append nodes to array filtering out duplicates .
function collect(node) {
    var index = -1
    if ('length' in node) {
      while (++index < node.length) {
        collectOne(node[index])
      }
    } else {
      collectOne(node)
    }
  }
function collect ( node ) { var index = - 1 if ( 'length' in node ) { while ( ++ index < node . length ) { collectOne ( node [ index ] ) } } else { collectOne ( node ) } }
Append nodes to array, filtering out duplicates.
Append nodes to array filtering out duplicates .