Re: [nodejs] variable scope in for loops

2015-05-23 Thread Prabhash Rathore
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 wro

Re: [nodejs] variable scope in for loops

2015-05-23 Thread Ryan Schmidt
On May 23, 2015, at 6:19 PM, Marc Phillips wrote: > I'm building up an object (or trying to) iterating though a json object and > gathering info based various rest calls: > > var generate = {}; > for(var protocol in buildout.protocols){ > for(var item in buildout

Re: [nodejs] variable scope in for loops

2015-05-23 Thread John Shaver
Hey Marc, Generate is not an array, but an object (which can be used as a key/value store). There are a couple of possible problems, assigning to the object instead of a property on the object, or assigning everything with the same key. Unfortunately, without more code (like the code that assig

[nodejs] variable scope in for loops

2015-05-23 Thread Marc Phillips
I'm building up an object (or trying to) iterating though a json object and gathering info based various rest calls: var generate = {}; for(var protocol in buildout.protocols){ for(var item in buildout.protocols[protocol]){ switch (item) {

[nodejs] Node v0.12.4 (Stable)

2015-05-23 Thread julien . gilli
Hi everyone, There's a new stable release of Node.js available, node v0.12.4. Here are the details: 2015.05.22, Version 0.12.4 (Stable) * npm: upgrade to 2.10.1 * V8: revert v8 Array.prototype.values() removal (cjihrig) * win: bring back xp/2k3 support (Bert Belder) Source Code: http://node