But! Just to be a nitpicky jerk (and because it's oddly amusing to me to notice this):
Your three initial Array prototype extensions are odds, double, and log. I don't know if there's a defined principle for this, but method naming should be consistent enough to allow for a certain amount of expectation to be met by the developer. My immediate assumption was that log() would return an array of the log of each current array member, consistent with double() (this is why I'm amused with myself, because that's such an unlikely method that has way less value). This speaks to the value of namespacing for the value of grouping methods by functionality. Maybe an Array.Math object would have any math related extensions while Array.Utils could have log(). Or maybe I'm wrong?
Obviously it's not central or relevant to your article, just noticed and thought it is its own interesting topic.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Really good article. Very insightful!
But! Just to be a nitpicky jerk (and because it's oddly amusing to me to notice this):
Your three initial Array prototype extensions are
odds
,double
, andlog
. I don't know if there's a defined principle for this, but method naming should be consistent enough to allow for a certain amount of expectation to be met by the developer. My immediate assumption was thatlog()
would return an array of the log of each current array member, consistent withdouble()
(this is why I'm amused with myself, because that's such an unlikely method that has way less value). This speaks to the value of namespacing for the value of grouping methods by functionality. Maybe anArray.Math
object would have any math related extensions whileArray.Utils
could havelog()
. Or maybe I'm wrong?Obviously it's not central or relevant to your article, just noticed and thought it is its own interesting topic.