News for hackers. Stuff that matters.
Re:Useful and useless code comments by ninthcat on Thursday June 17, 2021 @11:59PM (#27547220)
If you rewrite it so it's no longer a cryptic one-liner, it's probably easier to understand this way without a comment than the other way with one.

    return this.page.$eval(selector, (node) => Array
      .from(node.childNodes)
      .filter((child) => child.nodeType == Node.TEXT_NODE)
      .map((child) => child.nodeValue)
      .join('')
      .replace(/\s+/g, ' ')
      .trim()
    );
Re:Useful and useless code comments by dmurray on Friday June 18, 2021 @07:19AM (#27549276)
Hope this refactor was well unit tested, because it looks to do something a lot different from the original code.