Skip to main content
Module

x/rambda/source/slice.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import {slice} from './slice'
test('slice', () => { expect(slice(1, 3, ['a', 'b', 'c', 'd'])).toEqual(['b', 'c']) expect(slice(1, Infinity, ['a', 'b', 'c', 'd'])).toEqual(['b', 'c', 'd']) expect(slice(0, -1, ['a', 'b', 'c', 'd'])).toEqual(['a', 'b', 'c']) expect(slice(-3, -1, ['a', 'b', 'c', 'd'])).toEqual(['b', 'c']) expect(slice(0, 3, 'ramda')).toEqual('ram')})