@stdlib/ndarray-base-assert-is-read-only
v0.2.2
Published
Test if an ndarray is read-only.
Downloads
587
Readme
isReadOnly
Test if an ndarray is read-only.
Installation
npm install @stdlib/ndarray-base-assert-is-read-only
Usage
var isReadOnly = require( '@stdlib/ndarray-base-assert-is-read-only' );
isReadOnly( arr )
Tests if an ndarray is read-only.
var array = require( '@stdlib/ndarray-array' );
var x = array( [ 1, 2, 3, 4 ], {
'readonly': true
});
var bool = isReadOnly( x );
// returns true
Examples
var array = require( '@stdlib/ndarray-array' );
var isReadOnly = require( '@stdlib/ndarray-base-assert-is-read-only' );
var x = array( [ [ 1, 2 ], [ 3, 4 ] ], {
'readonly': true
});
var bool = isReadOnly( x );
// returns true
x = array( [ [ 1, 2 ], [ 3, 4 ] ], {
'readonly': false
});
bool = isReadOnly( x );
// returns false
x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
bool = isReadOnly( x );
// returns false
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.