You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there! I think for the sake of simplicity, you extend the prototype of Array. To communicate best practices, I'd like to come up with examples that do not extend the global Array object.
The alternative, to create objects from scratch is also more real-world oriented.
While I agree, we'd have to either create our own List or some other type that implements all the relevant type classes. I have mixed feelings on whether that'd make it harder to understand
if we choose to create List is the reader gonna ask "Why are you reimplementing array in a feature-poor way?"
If we choose Maybe then it may be trying to teach too many ideas at once.
If we choose Identity then it becomes hard to justify as valuable and stay terse.
Hey there! I think for the sake of simplicity, you extend the prototype of
Array
. To communicate best practices, I'd like to come up with examples that do not extend the global Array object.The alternative, to create objects from scratch is also more real-world oriented.
Here is a list of examples that use
prototype
Thank you.
The text was updated successfully, but these errors were encountered: