repl.txt (1887B)
1 2 {{alias}}( size ) 3 Returns an array buffer having a specified number of bytes. 4 5 Buffer contents are initialized to 0. 6 7 Parameters 8 ---------- 9 size: integer 10 Number of bytes. 11 12 Returns 13 ------- 14 out: ArrayBuffer 15 An array buffer. 16 17 Examples 18 -------- 19 > var buf = new {{alias}}( 5 ) 20 <ArrayBuffer> 21 22 23 {{alias}}.length 24 Number of input arguments the constructor accepts. 25 26 Examples 27 -------- 28 > {{alias}}.length 29 1 30 31 32 {{alias}}.isView( arr ) 33 Returns a boolean indicating if provided an array buffer view. 34 35 Parameters 36 ---------- 37 arr: any 38 Value to test. 39 40 Returns 41 ------- 42 bool: boolean 43 Boolean indicating if an input argument is a buffer view. 44 45 Examples 46 -------- 47 > var arr = new {{alias:@stdlib/array/float64}}( 10 ); 48 > {{alias}}.isView( arr ) 49 true 50 51 52 {{alias}}.prototype.byteLength 53 Read-only property which returns the length (in bytes) of the array buffer. 54 55 Examples 56 -------- 57 > var buf = new {{alias}}( 5 ); 58 > buf.byteLength 59 5 60 61 62 {{alias}}.prototype.slice( [start[, end]] ) 63 Copies the bytes of an array buffer to a new array buffer. 64 65 Parameters 66 ---------- 67 start: integer (optional) 68 Index at which to start copying buffer contents (inclusive). If 69 negative, the index is relative to the end of the buffer. 70 71 end: integer (optional) 72 Index at which to stop copying buffer contents (exclusive). If negative, 73 the index is relative to the end of the buffer. 74 75 Returns 76 ------- 77 out: ArrayBuffer 78 A new array buffer whose contents have been copied from the calling 79 array buffer. 80 81 Examples 82 -------- 83 > var b1 = new {{alias}}( 10 ); 84 > var b2 = b1.slice( 2, 6 ); 85 > var bool = ( b1 === b2 ) 86 false 87 > b2.byteLength 88 4 89 90 See Also 91 -------- 92