Skip to content

Instantly share code, notes, and snippets.

@iamstarkov
Forked from anonymous/let.js
Last active November 11, 2016 21:10
Show Gist options
  • Save iamstarkov/c866a054f2c68cef30749bb35adb54fc to your computer and use it in GitHub Desktop.
Save iamstarkov/c866a054f2c68cef30749bb35adb54fc to your computer and use it in GitHub Desktop.
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