Ad
  • Custom User Avatar

    habit. in react etc to trigger an update props/state need to be actually different objects, not mutations. spread makes a new object instead of mutating, but if that doesn't matter then push would be a bit of a performance gain

  • Custom User Avatar

    nice job---and thanks for making the names more descriptive. i already mentioned that you don't need the temporary variables since replace is not mutating, so yeah...

    aside from that, i would just note that your regex doesn't need the [a-z] you've got in there, since \w+ handles "word characters, one or more."