On Feb 3, 1:54 pm, Brad <bradavo...@gmail.com> wrote:
> TJ, thanks for correcting the docs. I hadn't noticed that error
> either.
>
> Are you suggesting that there no intersection of Prototype and Ruby
> communities? I only know of Prototype because of Ruby on Rails.
>
> Let's take Hash#reject() as an example. Let's say I'm moving server-
> side Ruby code to my Prototype-enhanced client-side.
>
> Ruby code:
> { "a" => 100, "b" => 200, "c" => 300 }.reject {|key, value| key ==
> "b" }
> => {"a"=>100, "c"=>300}
>
> Translated to Javascript:
> $H({ "a": 100, "b": 200, "c": 300 }).reject(function(i) { return i.key
> == "b" })
> => [["a", 100], ["c", 300]]
>
> Prototype returns an array? What good is an array if I started with a
> hash? It is intuitive that a reject() method returns a subset of the
> original data structure and not convert it to an entirely different
> one.

Didn't we establish that this is a bug? ; )

--
kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to