Created
January 15, 2019 08:50
-
-
Save firestar300/317d8f0cb7b6764346fe02c9223db9d1 to your computer and use it in GitHub Desktop.
nextAll method with Vanilla JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const nextAll = element => { | |
const nextElements = [] | |
let nextElement = element | |
while(nextElement.nextElementSibling) { | |
nextElements.push(nextElement.nextElementSibling) | |
nextElement = nextElement.nextElementSibling | |
} | |
return nextElements | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment