How can I run a conditional with ES6 to see if the nextElementSibling element exists or not?

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
}