Steven mudie4,741 Points
I wrote it two ways, both work
that line can be replaced with:
i understand the first one just reverses the up button but can someone explain what the second version is doing?
Steven Parker172,335 Points
The "after" method is another way to add an element to the DOM; but as you apparently noticed already, it's applied to a sibling instead of a parent.
Also, according to the MDN page, this method is classified as experimental, so it would not be recommended for use in production code.