i am dustin diaz

a JavaScriptr...

boosh.

don't worry about it.

for each in JavaScript

I felt that this deserves a tad more attention than just adding this to my del.icio.us bookmarks, but just moments ago I stumbled onto a JavaScript reference page on Mozilla's developer center that spoke of this intrigue about for each ( ... in ... ). I had no idea this existed! I looked over at Dan Webb who's sitting right across from me, and he agreed, it's news to him too. Granted it was implemented in JavaScript 1.6 (which means it will work in Firefox 1.5), but as far as I knew, these were the only things new in JavaScript 1.6.

Anyhow, it's nothing that special. It simply allows you to iterate over the values of an object, and not the keys. Nevertheless, it's nothing you can't already do with just a regular for (in) which returns you the keys of an object... so if you have the keys, and the object... you indeed, have access to the values. Go ahead, have a look.

this is who i am

Hi, my name is Dustin Diaz and I'm an Engineer @ObviousCorp. Previously @Twitter, @Google, and @Yahoo, author of Strobist® Info co-author of JavaScript Design Patterns, co-creator of the Ender JavaScript Framework, a Photographer, and an amateur Mixologist. This is my website. Welcome!

On this site I write about JavaScript. You can also follow along with my open-source work on Github.

This site is optimized and works best in Microsoft Internet Explorer 6.