diff --git a/README.md b/README.md index 706fdc0..5faec84 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ arr = indexspace( '[:-2]', 5 ); // returns [ 0, 1, 2 ] ``` -The function also recognizes the `end` keyword, which refers to the last index; i.e., `len-1`. If specified as the `stop` index, `end` is inclusive. +The function also recognizes the `end` keyword, which refers to the last index; i.e., `len-1`. If specified as the `stop` index, `end` is __inclusive__. ``` javascript var arr = indexspace( '[end::-1]', 5 ); @@ -60,6 +60,12 @@ var arr = indexspace( '[end::-1]', 5 ); arr = indexspace( '[:end]', 5 ); // returns [ 0, 1, 2, 3, 4 ] + +arr = indexspace( '[:end/2]', 5 ); +// returns [ 0, 1 ] + +arr = indexspace( '[end/2:]', 5 ); +// returns [ 2, 3, 4 ] ``` Basic arithmetic (subtraction and division) may be performed on the `end` keyword. The result from division is rounded up to the next integer.