Ad
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I like your regex solution! I learned a lot from it.

    notes/reminders for my benefit:

    1. replace returns a copy of the given string with modifications according to two parameters, target-to-change and replacement values.
    2. .replace method accepts a call back function that takes the result from matches as arguments. so when the regex finds a match it can perform the task of converting each match toUpperCase.
    3. logic of your regex: match any lower case character that appears at the start of a string or directly after a whitespace. - I like it!
  • Custom User Avatar

    I like how simple this is.
    As a beginner i'm still writing out the long version and explicitly declaring statements, so this is very useful to see the shorthand versions of the same thing.

    note for my benefit:
    learnings from yours:

    1. brackets not necessary for simple conditional test.
    2. '!' operator understood as 'not true' is the same as '=== false'.
  • Custom User Avatar

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