- From: Henri Sivonen <hsivonen@iki.fi>
- Date: Tue, 1 Apr 2008 17:54:58 +0300
- To: "Web APIs WG (public)" <public-webapi@w3.org>
On Apr 1, 2008, at 17:36, Henri Sivonen wrote:
> I think using
> var e = p.firstElementChild;
> while (e != null) {
> ...
> e = e.nextElementChild
> }
> to iterate over child elements is a cleaner idiom than introducing
> an index that isn't used for random access but only for forward
> iteration.
Even cleaner if written as a for loop:
for (var e = p.firstElementChild; e != null; e = e.nextElementChild) {
...
}
--
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Tuesday, 1 April 2008 14:55:42 UTC