You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # array-slice [![NPM version](https://img.shields.io/npm/v/array-slice.svg?style=flat)](https://www.npmjs.com/package/array-slice) [![NPM monthly downloads](https://img.shields.io/npm/dm/array-slice.svg?style=flat)](https://npmjs.org/package/array-slice) [![NPM total downloads](https://img.shields.io/npm/dt/array-slice.svg?style=flat)](https://npmjs.org/package/array-slice) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/array-slice.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/array-slice)
  2. > Array-slice method. Slices `array` from the `start` index up to, but not including, the `end` index.
  3. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
  4. ## Install
  5. Install with [npm](https://www.npmjs.com/):
  6. ```sh
  7. $ npm install --save array-slice
  8. ```
  9. This function is used instead of `Array#slice` to support node lists in IE < 9 and to ensure dense arrays are returned. This is also faster than native slice in some cases.
  10. ## Usage
  11. ```js
  12. var slice = require('array-slice');
  13. var arr = ['a', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];
  14. slice(arr, 3, 6);
  15. //=> ['e', 'f', 'g']
  16. ```
  17. ## About
  18. <details>
  19. <summary><strong>Contributing</strong></summary>
  20. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
  21. </details>
  22. <details>
  23. <summary><strong>Running Tests</strong></summary>
  24. Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
  25. ```sh
  26. $ npm install && npm test
  27. ```
  28. </details>
  29. <details>
  30. <summary><strong>Building docs</strong></summary>
  31. _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
  32. To generate the readme, run the following command:
  33. ```sh
  34. $ npm install -g verbose/verb#dev verb-generate-readme && verb
  35. ```
  36. </details>
  37. ### Related projects
  38. You might also be interested in these projects:
  39. * [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays.")
  40. * [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique "Remove duplicate values from an array. Fastest ES5 implementation.")
  41. * [array-xor](https://www.npmjs.com/package/array-xor): Returns the symmetric difference (exclusive-or) of an array of elements (elements that are present in… [more](https://github.com/jonschlinkert/array-xor) | [homepage](https://github.com/jonschlinkert/array-xor "Returns the symmetric difference (exclusive-or) of an array of elements (elements that are present in all given arrays and not in their intersections).")
  42. ### Author
  43. **Jon Schlinkert**
  44. * [github/jonschlinkert](https://github.com/jonschlinkert)
  45. * [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
  46. ### License
  47. Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
  48. Released under the [MIT License](LICENSE).
  49. ***
  50. _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 30, 2017._