Ad
  • Custom User Avatar

    First point is correct but your second point is wrong. Becuase zero is falsy as well your suggested filter function would drop 0 from the result and fail when the first letter is upper case.

  • Custom User Avatar

    The first iteration will compare the first element and undefined.
    iterable[-1] does not wrap around but will return undefined as there is no index -1.
    iterable.at(-1) is required to wrap around and get the last element of an array.