Joined June 2012
·
Posted to
Neat way to loop through an array in JS
over 1 year
ago
I think it's important to note that this also removes the elements from the array.
Achievements
158 Karma
0 Total ProTip Views

Narwhal
Have at least one original repo where Clojure is the dominant language

Philanthropist
Truly improve developer quality of life by sharing at least 50 individual open source projects

Github Gameoff Participant
Participated in the Github Gameoff 2012 building a game based on git concepts of forking, branching, etc

Honey Badger 3
Have at least three Node.js specific repos

Honey Badger
Have at least one original Node.js-specific repo

Altruist
Increase developer well-being by sharing at least 20 open source projects

Kona
Have at least one original repo where CoffeeScript is the dominant language

Mongoose
Have at least one original repo where Ruby is the dominant language

Nephila Komaci
Have at least one original repos where PHP is the dominant language

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Forked
Have a project valued enough to be forked by someone else

Charity
Fork and commit to someone's open source project in need

Python
Would you expect anything less? Have at least one original repo where Python is the dominant language

Cub
Have at least one original jQuery or Prototype open source repo

Raven
Have at least one original repo where some form of shell script is the dominant language
Nice. There's a couple of things I'd tweak though.
sel || ☺
is inefficient. It'd be better to return early if no selector is passed. You could even return an empty NodeList usingdocument.createDocumentFragment().childNodes