time-to-botec

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

README.md (2789B)


      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 # isArrayBuffer
     22 
     23 > Test if a value is an [ArrayBuffer][mdn-arraybuffer].
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );
     31 ```
     32 
     33 #### isArrayBuffer( value )
     34 
     35 Tests if a value is an [`ArrayBuffer`][mdn-arraybuffer].
     36 
     37 ```javascript
     38 var ArrayBuffer = require( '@stdlib/array/buffer' );
     39 
     40 var bool = isArrayBuffer( new ArrayBuffer( 10 ) );
     41 // returns true
     42 
     43 bool = isArrayBuffer( [] );
     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 Float32Array = require( '@stdlib/array/float32' );
     59 var Float64Array = require( '@stdlib/array/float64' );
     60 var Int8Array = require( '@stdlib/array/int8' );
     61 var Int16Array = require( '@stdlib/array/int16' );
     62 var Int32Array = require( '@stdlib/array/int32' );
     63 var Uint8Array = require( '@stdlib/array/uint8' );
     64 var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
     65 var Uint16Array = require( '@stdlib/array/uint16' );
     66 var Uint32Array = require( '@stdlib/array/uint32' );
     67 var ArrayBuffer = require( '@stdlib/array/buffer' );
     68 var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );
     69 
     70 var bool = isArrayBuffer( new ArrayBuffer( 10 ) );
     71 // returns true
     72 
     73 bool = isArrayBuffer( new Float32Array( 10 ) );
     74 // returns false
     75 
     76 bool = isArrayBuffer( new Int8Array( 10 ) );
     77 // returns false
     78 
     79 bool = isArrayBuffer( new Uint8Array( 10 ) );
     80 // returns false
     81 
     82 bool = isArrayBuffer( new Uint8ClampedArray( 10 ) );
     83 // returns false
     84 
     85 bool = isArrayBuffer( new Int16Array( 10 ) );
     86 // returns false
     87 
     88 bool = isArrayBuffer( new Uint16Array( 10 ) );
     89 // returns false
     90 
     91 bool = isArrayBuffer( new Int32Array( 10 ) );
     92 // returns false
     93 
     94 bool = isArrayBuffer( new Uint32Array( 10 ) );
     95 // returns false
     96 
     97 bool = isArrayBuffer( new Float64Array( 10 ) );
     98 // returns false
     99 
    100 bool = isArrayBuffer( new Array( 10 ) );
    101 // returns false
    102 
    103 bool = isArrayBuffer( {} );
    104 // returns false
    105 
    106 bool = isArrayBuffer( null );
    107 // returns false
    108 ```
    109 
    110 </section>
    111 
    112 <!-- /.examples -->
    113 
    114 <section class="links">
    115 
    116 [mdn-arraybuffer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
    117 
    118 </section>
    119 
    120 <!-- /.links -->