Skip to content

extra-array-view 1.0.0

Install from the command line:
Learn more about npm packages
$ npm install @nodef/extra-array-view@1.0.0
Install via package.json:
"@nodef/extra-array-view": "1.0.0"

About this version

An array view is a proxy to an underlying array.
πŸ“¦ Node.js, 🌐 Web, πŸ“œ Files, πŸ“° Docs, πŸ“˜ Wiki.


This package provides a view to an underlying array. It is a proxy of the array, and any changes made to it are reflected in the underlying array. It is similar to a slice of an array, but it does not copy the array. To obtain a view, use the fromArray() function.

With this package, you can simplify the implementation of complex algorithms. Try it out today! This package is available in Node.js and Web formats. To use it on the web, simply use the extra_array_view global variable after loading with a <script> tag from the jsDelivr CDN.

Stability: Experimental.


const xarrayView = require('extra-array-view');
// import * as xarrayView from "extra-array-view";
// import * as xarrayView from "https://unpkg.com/extra-array-view/index.mjs"; (deno)

var x = [10, 40, 30, 20, 50];
var y = xarrayView.fromArray(x, 1, 4);

y[0];
// β†’ 40

y[1];
// β†’ 30

y.at(-1);
// β†’ 20

y.sort();
x;
// β†’ [ 10, 20, 30, 40, 50 ]

y.reverse();
x;
// β†’ [ 10, 40, 30, 20, 50 ]

y.fill(0);
x;
// β†’ [ 10, 0, 0, 0, 50 ]


Index

Property Description
fromArray Convert array range to array view.


References




ORG Coverage Status Test Coverage

Details


Assets

  • extra-array-view-1.0.0.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0