clean-code-javascript
clean-code-javascript copied to clipboard
Suggestions for "Don't write to global functions"
Just a suggestion, but I think the example conflicts a bit with other philosophies espoused in this repo.
-
SuperArray. is not a descriptive name.DiffableArrayor something like that may be better. - I can't find any concrete resources on this, but I think that extending global objects like
Arrayshould be avoided. I could be totally off base about this perspective, though. - Additionally, from the perspective of favoring functional programming as well as JavaScripts ability to have global functions I think a
diffArray(array, compareToArray)would be more appropriate here. It seems like future sections expand on this a little bit more, but I don't think the goal of this document is to provide progressive information.