Not tested, but i think i got this problem before.
The each at Line 9 returns imidiately, so the callback Line 33 get executed before the array is filed.
You might have a look at array filter/map (and/or take the nodeschool.io functional programming lesson).
Not tested, but i think i got this problem before.
The each at Line 9 returns imidiately, so the callback Line 33 get executed before the array is filed.
You might have a look at array filter/map (and/or take the nodeschool.io functional programming lesson).