Hi Marc, Looks like you are overwriting the objects with the next
subsequent values and hence you are left with the last value in your
object. Make sure you copy values in new object for each iteration instead
of just overwriting the same object.

On Sat, May 23, 2015 at 4:19 PM, Marc Phillips <rmar...@gmail.com> wrote:

>
> I'm building up an object (or trying to) iterating though a json object
> and gathering info based various rest calls:
> <pre>
>         var generate = {};
>         for(var protocol in buildout.protocols){
>                 for(var item in buildout.protocols[protocol]){
>                   switch (item) {
>                    .....
> </pre>
>
> The problem I'm having is that after the for loop, the generate array only
> holds the value of the last update, all the other info is missing.
> I'm sure I'm doing something obviously wrong here (converting some
> automation scripts from perl to node).
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/4c4c2ab2-2077-4ff2-a29f-a9f826a3e210%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/4c4c2ab2-2077-4ff2-a29f-a9f826a3e210%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAFw09gKPTbZ_t59p4VUri5vSVyedX6t5%3D1d3PO1dhEeuFZ_kPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to