DEV Community

Cover image for Iterating over objects and arrays: frequent errors

Iterating over objects and arrays: frequent errors

Victoria Drake on May 18, 2017

Here's some complaining a quick overview of some code that has confounded me more than once. I'm told even very experienced developers encounter th...
Collapse
 
rrackiewicz profile image
rrackiewicz

Hi Vicky. Nice read. I would highly recommend making the shift to functional programming to iterate over collections. I really got excited about functional programming when I began doing code challenges on codewars.com. When I would submit my answers (written in my old clunky imperative style) I would always see how other solved the same problem. The most simple and elegant answers were ALWAYS written declaratively and I was jealous! So I embraced foreach (now for of in ES6), map, filter, reduce, and all other manners of functional programming and I'm happy with how simple my coding has become.

Collapse
 
chakzefir profile image
chakzefir

Vicky, and what is the main point of this article, why working title was "Javascript sucks" ?

Collapse
 
victoria profile image
Victoria Drake

This is a list of things I would frequently mix up or forget in JS. I suppose the main point is that JS can be confusing, and to provide a handy reference for myself and anyone else who's come looking. :) Just in case someone's feeling like they're all alone in being confused, you can read this and see you're not the only one!