Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Yay! I love a good functional programing polyglot! We could use a little more support.

  • Custom User Avatar

    @cu6upb like monking said, the real problem is that your editing something that's not yours (the global string object) Which means that if somone imports your library it would at worst break their code because you've changed the way the string behaves.

    It is ok however to use prototypal inheritance to make your own sub-objects and those you can edit to your hearts desire. I've never tried to do it with a built in type (besides Object) but I bet you can.

  • Custom User Avatar

    Clever although I would say adding onto String's prototype is bad practice.