-
-
Save iamstarkov/c866a054f2c68cef30749bb35adb54fc to your computer and use it in GitHub Desktop.
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
const toArray = iterables => { | |
var res = []; | |
for (var i = 0; i < iterables.length; i++) { | |
res[i] = iterables[i]; | |
} | |
return res; | |
} | |
const query = selector => toArray(document.querySelectorAll(selector)); | |
query('.btn').forEach((button, i) => { | |
button.innerText = i + 1; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment