dd-shiftby

1.0.1 • Public • Published

dd-shiftBy

The package, when required, adds a "shiftBy" method to the Array prototype. The method should shift each element of the array by n spaces.

Installing

npm install --save dd-shiftby

And in Node:

var shiftBy = require('dd-shiftby');
var arr = [];

arr.shiftBy(number);

Examples

[1, 2, 3].shiftBy(1); // outputs [3, 1, 2]
[1, 2, 3].shiftBy(-4); // outputs [2, 3, 1]

Authors

Readme

Keywords

none

Package Sidebar

Install

npm i dd-shiftby

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

2.06 kB

Total Files

4

Last publish

Collaborators

  • cldeaton