loading...

re: Common Node.js mistakes in Lambda VIEW POST

FULL DISCUSSION
 

I spent countless hours (well not countless, but probably hours totaling 3-4 days' worth of effort) debugging "mysterious" bugs in my Lambda. At one point I acted on a hunch and replaced a forEach loop with a traditional for loop, and the problem was solved! Today I was doing another debugging and was equally frustrated; then I was reminded of what had worked last time: I changed the forEach loop to for loop and problem solved!

This time I had to Google "node Lambda don't use forEach" because I was sure there was something to it ... and I landed here! Please keep posting! :)

 

haha, you're not alone in this - I have run into the same problem (it's not isolated to Lambda by the way) multiple times myself before it's finally carved in stone in my head. It's a systematic failure on the part of the language that it doesn't work intuitively, and unless it improves at the language level we have to (sadly) rely on memorization and building up muscle memory individually.

code of conduct - report abuse