time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (2669B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # isUint16Array
     22 
     23 > Test if a value is a [Uint16Array][mdn-uint16array].
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var isUint16Array = require( '@stdlib/assert/is-uint16array' );
     31 ```
     32 
     33 #### isUint16Array( value )
     34 
     35 Tests if a value is a [`Uint16Array`][mdn-uint16array].
     36 
     37 ```javascript
     38 var Uint16Array = require( '@stdlib/array/uint16' );
     39 
     40 var bool = isUint16Array( new Uint16Array( 10 ) );
     41 // returns true
     42 
     43 bool = isUint16Array( [] );
     44 // returns false
     45 ```
     46 
     47 </section>
     48 
     49 <!-- /.usage -->
     50 
     51 <section class="examples">
     52 
     53 ## Examples
     54 
     55 <!-- eslint no-undef: "error" -->
     56 
     57 ```javascript
     58 var Int8Array = require( '@stdlib/array/int8' );
     59 var Uint8Array = require( '@stdlib/array/uint8' );
     60 var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
     61 var Int16Array = require( '@stdlib/array/int16' );
     62 var Uint16Array = require( '@stdlib/array/uint16' );
     63 var Int32Array = require( '@stdlib/array/int32' );
     64 var Uint32Array = require( '@stdlib/array/uint32' );
     65 var Float32Array = require( '@stdlib/array/float32' );
     66 var Float64Array = require( '@stdlib/array/float64' );
     67 var isUint16Array = require( '@stdlib/assert/is-uint16array' );
     68 
     69 var bool = isUint16Array( new Uint16Array( 10 ) );
     70 // returns true
     71 
     72 bool = isUint16Array( new Int8Array( 10 ) );
     73 // returns false
     74 
     75 bool = isUint16Array( new Uint8Array( 10 ) );
     76 // returns false
     77 
     78 bool = isUint16Array( new Uint8ClampedArray( 10 ) );
     79 // returns false
     80 
     81 bool = isUint16Array( new Int16Array( 10 ) );
     82 // returns false
     83 
     84 bool = isUint16Array( new Int32Array( 10 ) );
     85 // returns false
     86 
     87 bool = isUint16Array( new Uint32Array( 10 ) );
     88 // returns false
     89 
     90 bool = isUint16Array( new Float32Array( 10 ) );
     91 // returns false
     92 
     93 bool = isUint16Array( new Float64Array( 10 ) );
     94 // returns false
     95 
     96 bool = isUint16Array( new Array( 10 ) );
     97 // returns false
     98 
     99 bool = isUint16Array( {} );
    100 // returns false
    101 
    102 bool = isUint16Array( null );
    103 // returns false
    104 ```
    105 
    106 </section>
    107 
    108 <!-- /.examples -->
    109 
    110 <section class="links">
    111 
    112 [mdn-uint16array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array
    113 
    114 </section>
    115 
    116 <!-- /.links -->