Skip to content

Instantly share code, notes, and snippets.

@alexmccabe
Created October 5, 2018 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmccabe/d092da1209579b9180d199c44c0b01f5 to your computer and use it in GitHub Desktop.
Save alexmccabe/d092da1209579b9180d199c44c0b01f5 to your computer and use it in GitHub Desktop.
const getSiblings = (element) => {
return Array.prototype
.slice
.call(element.parentNode.children)
.filter(item => item !== element);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment