listfun = [["My RSS image", "http://nickmudge.info/valid-rss.png"], ["Google Birthday image", "http://www.google.com/logos/9th_birthday.gif"], ["Blogger image", "http://www.blogger.com/img/logo100.gif"]]
Beautiful, but it doesn't look like an array, it looks like a list! A list of lists. So is it an array or a list?
27 September 2007
1.) While the syntax is the same, the one nice thing about JS is that (as far as I know), arrays are O(1) access. So while a haskell programmer shudders every time he sees list !! 3, it's perfectly natural to do list in JS.
2.) Arrays actually have some nice functional methods that will be familiar to haskell programmers. For example:
array.map(f) === map f array
array.every(p) === all p array
array.filter(p) === filter p array
array.reverse() === reverse array
array.some(p) === any p array
28 September 2007
That's awesome. Thanks.