jashkenas/coffee-script — Issue #1766: Array slicing with negative end index is undocumented
Author: akheron
Created: 2011-10-11 10:19:13+00:00
State: open

It took me a while to understand why:

a = [1, 2, 3, 4]
a[0..-1]

returns the whole array instead of an empty array. The support for negative end index in array slices should be documented.

(FWIW, I find this behavior confusing and harmful because negative indices like `a[-1]` are not supported, and they probably even cannot be supported in a clean way.)