I am trying to run a pretty basic conditional to determine if a current element has a next sibling or not using ES6.
I have tried to determine if nextElementSibling returns as null
but this silently fails.
if (el.nextElementSibling == null) {
// do something if there is no next sibling
} else {
// do something if there is a next sibling
}