Ad
  • Custom User Avatar

    If an initial value is provided to the reduce method, the first argument is the initial value and the second argument is the value of the first (!) element in the array.
    If an initial value is not provided, the first argument is the value of the first element in the array and the second argument is the value of the second (!) element in the array.

  • Custom User Avatar

    Will be broken with string including numbers, like ["Flight93", "Flight 123"], or with non-ASCII characters. That's why localeCompare() should be required.