Ad
  • Default User Avatar

    When you copy an array using the assignment operator (equal sign) and you modifiy the copied array you mutate/modify the original array as well.
    If you don't want to modify the original array it's best to use spread syntax (other options as well to do this)

    In our case, he assinged the a,b,c in an [array] first and secondly he assigned the value of running [sort] through it thus what's on the left will be exactly to what's on the right.

    So when he returns [a and b] he knows that a trianlge can only have 3 lengths and they're the shortests.

    Hope that answered your questions, let me know if you need clarification.

  • Default User Avatar

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