Ad
  • Custom User Avatar

    Each iteration will currently overwrite the value of var 'result'.

    • 'var x = y' --> y
    • 'x = z' --> z

    You need the '+=' operator:

    • 'var x += y' --> y
    • 'x += z' --> yz

    Thus you're not considering some conditions:

    • when adding the first name to 'result' you had to enter just the value, without any commas or ampersand;
    • names.length can be 1 or 0.

    Good luck and do your best!