From 954bdf6223416a5fce3bb58d5ef5e81c95ee3fa6 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 19 Sep 2023 20:12:22 +0000 Subject: [PATCH] Auto-generated commit --- fancy/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fancy/README.md b/fancy/README.md index 21daeeed..8840bce3 100644 --- a/fancy/README.md +++ b/fancy/README.md @@ -31,6 +31,7 @@ limitations under the License. A **FancyArray** is an [`ndarray`][@stdlib/ndarray/ctor] which supports slicing via indexing expressions. ```javascript +var ndarray2array = require( '@stdlib/ndarray/to-array' ); var FancyArray = require( '@stdlib/ndarray/fancy' ); var buffer = [ 1, 2, 3, 4, 5, 6 ]; @@ -41,21 +42,21 @@ var x = new FancyArray( 'generic', buffer, [ 6 ], [ 1 ], 0, 'row-major' ); var y = x[ ':3' ]; // returns -var arr = toArray( y ); +var arr = ndarray2array( y ); // returns [ 1, 2, 3 ] // Select every other element, starting with the second element: y = x[ '1::2' ]; // returns -arr = toArray( y ); +arr = ndarray2array( y ); // returns [ 2, 4, 6 ] // Reverse the array, starting with last element and skipping every other element: y = x[ '::-2' ]; // returns -arr = toArray( y ); +arr = ndarray2array( y ); // returns [ 6, 4, 2 ] ```