@stdlib/assert-is-slice
v0.2.2
Published
Test if a value is a Slice object.
Downloads
858
Readme
isSlice
Test if a value is a
Slice
.
Installation
npm install @stdlib/assert-is-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
See Also
@stdlib/assert-is-multi-slice
: test if a value is a MultiSlice object.@stdlib/slice-ctor
: slice constructor.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.