3 ms·
I think whatever performance cost might exist with Object.keys and Array#forEach vs loops is outweighed in most cases by a pretty significant increase in readab
by kevincennis 13y ago
I think whatever performance cost might exist with Object.keys and Array#forEach vs loops is outweighed in most cases by a pretty significant increase in readability. There are exceptions, of course, but I think the performance card gets played too often in cases where the difference is negligible.
As for self = this, I tend to agree that it's kind of gross in most cases. It's not something I use very often. But unless you're willing to say that you're never going to use anonymous functions, the reality is that sometimes it's useful.