What is your recommendation ?

On May 30, 3:34 pm, Michael Peters <[EMAIL PROTECTED]> wrote:
> Sapna Grover wrote:
> > Thanks for your response.
> > In our legacy code we can't use the object notation to replace the
> > array object because we rely on Array specific methods like push.
> > Should we use Prototype Hash Object ? It doesn't seem to contain
> > methods to add and remove elements.
> > Any Suggestions?
>
> I don't think he was suggesting you do that. He was just pointing out that 
> using
> an Array like an object is just like using Object.
>
> Simply put, for..in is not intended to be used for Array, but Object. It loops
> over *every* property in the *object*. It just so happens that Array is also 
> an
> Object and by default does not have any extra properties other than the 
> indexed
> elements.
>
> --
> Michael Peters
> Developer
> Plus Three, LP


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to