slice

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
27
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
1 KB
Returns the elements of the given list or string (or object with a `slice` method) from `fromIndex` (inclusive) to `toIndex` (exclusive).
1 contributor
Install slice as a package?
Copied
npm i @bit/justin-capalbo.ramda.slice
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
slice (
fromIndex:Number,
toIndex:Number,
list:*
) : *

Returns the elements of the given list or string (or object with a slice method) from fromIndex (inclusive) to toIndex (exclusive).

Dispatches to the slice method of the third argument, if present.

Example
R.slice(1, 3, ['a', 'b', 'c', 'd']);        //=> ['b', 'c']
     R.slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']
     R.slice(0, -1, ['a', 'b', 'c', 'd']);       //=> ['a', 'b', 'c']
     R.slice(-3, -1, ['a', 'b', 'c', 'd']);      //=> ['b', 'c']
     R.slice(0, 3, 'ramda');                     //=> 'ram'
Arguments
fromIndex: Number

The start index (inclusive).

toIndex: Number

The end index (exclusive).

list: *
Returns
*

Help and resources