News for hackers. Stuff that matters.
Re:A little bit of plain JavaScript can do a lot by hombre_fatal on Sunday June 21, 2020 @08:41AM (#23591705)
At a glance, they do it so that at the end they can merge in any remaining props they didn't handle after all their work building `elem` is done.

This can be accomplished non-destructively with destructuring.

    const {
      attributes,
      classList,
      style,
      ...rest
    } = p

    // elem = ...consume attributes, classList, style...

    return Object.assign(elem, rest)
Re:A little bit of plain JavaScript can do a lot by enlyth on Sunday June 21, 2020 @10:09AM (#23592108)
This approach with destructuring is great but you will need to transpile the code if you're targeting IE11 which is still often the case in enterprise settings unfortunately.