That was my original version, then I thought writing two functions might confuse people so I changed it into this. It's just for the sake of demonstration and better readability.🤗But you were right, it is a bad habit to extend a native prototype.
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.
I was about to submit something like that, so have my applause instead 👏🎉
A little more thinking on the problem can really simplify the solution!
(On a side note, I wouldn't extend a native prototype, but that's out of context now 😅)
That was my original version, then I thought writing two functions might confuse people so I changed it into this. It's just for the sake of demonstration and better readability.🤗But you were right, it is a bad habit to extend a native prototype.