This can be accomplished non-destructively with destructuring.
const { attributes, classList, style, ...rest } = p // elem = ...consume attributes, classList, style... return Object.assign(elem, rest)
This can be accomplished non-destructively with destructuring.