Created
March 22, 2018 15:41
-
-
Save 6ui11em/7ab5238d291ff1cca45c21da7b8d15d2 to your computer and use it in GitHub Desktop.
Javascript NodeList to Array #javascript #js #es6
This file contains hidden or 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
| // ES6 method | |
| // Get all buttons as a NodeList | |
| var btns = document.querySelectorAll('button'); | |
| // Convert buttons NodeList to an array | |
| var btnsArr = Array.from(btns); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment