O'Reilly logo
  • Ignacio Garcia Villanueva thinks this is interesting:

For example, in the previous diagram, we have a stack with three items; therefore, the length of the internal array is 3. The last position used in the internal array is 2. As a result, the length - 1 (3 - 1) is 2!

From

Cover of Learning JavaScript Data Structures and Algorithms - Second Edition

Note

Shouldn't it be [2] 100, [1] 72 and [0] 81???