isSlice

Test if a value is a Slice.

Usage

var isSlice = require( '@stdlib/assert/is-slice' );

isSlice( value )

Tests if a value is a Slice.

var Slice = require( '@stdlib/slice/ctor' );

var s = new Slice( 0, 10 );

var bool = isSlice( s );
// returns true

Examples

var Slice = require( '@stdlib/slice/ctor' );
var isSlice = require( '@stdlib/assert/is-slice' );

var out = isSlice( new Slice( 0, 10, 1 ) );
// returns true

out = isSlice( {} );
// returns false

out = isSlice( null );
// returns false
Did you find this page helpful?