Skip to content

Commit 093c278

Browse files
committed
Document static methods
1 parent b9b2d90 commit 093c278

File tree

8 files changed

+448
-8
lines changed

8 files changed

+448
-8
lines changed

lib/node_modules/@stdlib/array/float64/README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,62 @@ var len = arr.length;
205205

206206
### Methods
207207

208-
TODO: add methods
208+
<a name="static-method-from"></a>
209+
210+
#### Float64Array.from( src\[, map\[, thisArg]] )
211+
212+
Creates a new typed array from an array-like `object` or an iterable.
213+
214+
```javascript
215+
var arr = Float64Array.from( [ 1.0, -1.0 ] );
216+
// returns <Float64Array>[ 1.0, -1.0 ]
217+
```
218+
219+
To invoke a function for each `src` value, provide a callback function.
220+
221+
```javascript
222+
function mapFcn( v ) {
223+
return v * 2.0;
224+
}
225+
226+
var arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn );
227+
// returns <Float64Array>[ 2.0, -2.0 ]
228+
```
229+
230+
A callback function is provided two arguments:
231+
232+
- `value`: source value
233+
- `index`: source index
234+
235+
To set the callback execution context, provide a `thisArg`.
236+
237+
```javascript
238+
function mapFcn( v ) {
239+
this.count += 1;
240+
return v * 2.0;
241+
}
242+
243+
var ctx = {
244+
'count': 0
245+
};
246+
247+
var arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn, ctx );
248+
// returns <Float64Array>[ 2.0, -2.0 ]
249+
250+
var n = ctx.count;
251+
// returns 2
252+
```
253+
254+
<a name="static-method-of"></a>
255+
256+
#### Float64Array.of( element0\[, element1\[, ...\[, elementN]]] )
257+
258+
Creates a new typed array from a variable number of arguments.
259+
260+
```javascript
261+
var arr = Float64Array.of( 1.0, -1.0 );
262+
// returns <Float64Array>[ 1.0, -1.0 ]
263+
```
209264

210265
</section>
211266

lib/node_modules/@stdlib/array/int16/README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,62 @@ var len = arr.length;
205205

206206
### Methods
207207

208-
TODO: add methods
208+
<a name="static-method-from"></a>
209+
210+
#### Int16Array.from( src\[, map\[, thisArg]] )
211+
212+
Creates a new typed array from an array-like `object` or an iterable.
213+
214+
```javascript
215+
var arr = Int16Array.from( [ 1, 2 ] );
216+
// returns <Int16Array>[ 1, 2 ]
217+
```
218+
219+
To invoke a function for each `src` value, provide a callback function.
220+
221+
```javascript
222+
function mapFcn( v ) {
223+
return v * 2;
224+
}
225+
226+
var arr = Int16Array.from( [ 1, 2 ], mapFcn );
227+
// returns <Int16Array>[ 2, 4 ]
228+
```
229+
230+
A callback function is provided two arguments:
231+
232+
- `value`: source value
233+
- `index`: source index
234+
235+
To set the callback execution context, provide a `thisArg`.
236+
237+
```javascript
238+
function mapFcn( v ) {
239+
this.count += 1;
240+
return v * 2;
241+
}
242+
243+
var ctx = {
244+
'count': 0
245+
};
246+
247+
var arr = Int16Array.from( [ 1, 2 ], mapFcn, ctx );
248+
// returns <Int16Array>[ 2, 4 ]
249+
250+
var n = ctx.count;
251+
// returns 2
252+
```
253+
254+
<a name="static-method-of"></a>
255+
256+
#### Int16Array.of( element0\[, element1\[, ...\[, elementN]]] )
257+
258+
Creates a new typed array from a variable number of arguments.
259+
260+
```javascript
261+
var arr = Int16Array.of( 1, 2 );
262+
// returns <Int16Array>[ 1, 2 ]
263+
```
209264

210265
</section>
211266

lib/node_modules/@stdlib/array/int32/README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,62 @@ var len = arr.length;
205205

206206
### Methods
207207

208-
TODO: add methods
208+
<a name="static-method-from"></a>
209+
210+
#### Int32Array.from( src\[, map\[, thisArg]] )
211+
212+
Creates a new typed array from an array-like `object` or an iterable.
213+
214+
```javascript
215+
var arr = Int32Array.from( [ 1, 2 ] );
216+
// returns <Int32Array>[ 1, 2 ]
217+
```
218+
219+
To invoke a function for each `src` value, provide a callback function.
220+
221+
```javascript
222+
function mapFcn( v ) {
223+
return v * 2;
224+
}
225+
226+
var arr = Int32Array.from( [ 1, 2 ], mapFcn );
227+
// returns <Int32Array>[ 2, 4 ]
228+
```
229+
230+
A callback function is provided two arguments:
231+
232+
- `value`: source value
233+
- `index`: source index
234+
235+
To set the callback execution context, provide a `thisArg`.
236+
237+
```javascript
238+
function mapFcn( v ) {
239+
this.count += 1;
240+
return v * 2;
241+
}
242+
243+
var ctx = {
244+
'count': 0
245+
};
246+
247+
var arr = Int32Array.from( [ 1, 2 ], mapFcn, ctx );
248+
// returns <Int32Array>[ 2, 4 ]
249+
250+
var n = ctx.count;
251+
// returns 2
252+
```
253+
254+
<a name="static-method-of"></a>
255+
256+
#### Int32Array.of( element0\[, element1\[, ...\[, elementN]]] )
257+
258+
Creates a new typed array from a variable number of arguments.
259+
260+
```javascript
261+
var arr = Int32Array.of( 1, 2 );
262+
// returns <Int32Array>[ 1, 2 ]
263+
```
209264

210265
</section>
211266

lib/node_modules/@stdlib/array/int8/README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,62 @@ var len = arr.length;
205205

206206
### Methods
207207

208-
TODO: add methods
208+
<a name="static-method-from"></a>
209+
210+
#### Int8Array.from( src\[, map\[, thisArg]] )
211+
212+
Creates a new typed array from an array-like `object` or an iterable.
213+
214+
```javascript
215+
var arr = Int8Array.from( [ 1, 2 ] );
216+
// returns <Int8Array>[ 1, 2 ]
217+
```
218+
219+
To invoke a function for each `src` value, provide a callback function.
220+
221+
```javascript
222+
function mapFcn( v ) {
223+
return v * 2;
224+
}
225+
226+
var arr = Int8Array.from( [ 1, 2 ], mapFcn );
227+
// returns <Int8Array>[ 2, 4 ]
228+
```
229+
230+
A callback function is provided two arguments:
231+
232+
- `value`: source value
233+
- `index`: source index
234+
235+
To set the callback execution context, provide a `thisArg`.
236+
237+
```javascript
238+
function mapFcn( v ) {
239+
this.count += 1;
240+
return v * 2;
241+
}
242+
243+
var ctx = {
244+
'count': 0
245+
};
246+
247+
var arr = Int8Array.from( [ 1, 2 ], mapFcn, ctx );
248+
// returns <Int8Array>[ 2, 4 ]
249+
250+
var n = ctx.count;
251+
// returns 2
252+
```
253+
254+
<a name="static-method-of"></a>
255+
256+
#### Int8Array.of( element0\[, element1\[, ...\[, elementN]]] )
257+
258+
Creates a new typed array from a variable number of arguments.
259+
260+
```javascript
261+
var arr = Int8Array.of( 1, 2 );
262+
// returns <Int8Array>[ 1, 2 ]
263+
```
209264

210265
</section>
211266

lib/node_modules/@stdlib/array/uint16/README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,62 @@ var len = arr.length;
205205

206206
### Methods
207207

208-
TODO: add methods
208+
<a name="static-method-from"></a>
209+
210+
#### Uint16Array.from( src\[, map\[, thisArg]] )
211+
212+
Creates a new typed array from an array-like `object` or an iterable.
213+
214+
```javascript
215+
var arr = Uint16Array.from( [ 1, 2 ] );
216+
// returns <Uint16Array>[ 1, 2 ]
217+
```
218+
219+
To invoke a function for each `src` value, provide a callback function.
220+
221+
```javascript
222+
function mapFcn( v ) {
223+
return v * 2;
224+
}
225+
226+
var arr = Uint16Array.from( [ 1, 2 ], mapFcn );
227+
// returns <Uint16Array>[ 2, 4 ]
228+
```
229+
230+
A callback function is provided two arguments:
231+
232+
- `value`: source value
233+
- `index`: source index
234+
235+
To set the callback execution context, provide a `thisArg`.
236+
237+
```javascript
238+
function mapFcn( v ) {
239+
this.count += 1;
240+
return v * 2;
241+
}
242+
243+
var ctx = {
244+
'count': 0
245+
};
246+
247+
var arr = Uint16Array.from( [ 1, 2 ], mapFcn, ctx );
248+
// returns <Uint16Array>[ 2, 4 ]
249+
250+
var n = ctx.count;
251+
// returns 2
252+
```
253+
254+
<a name="static-method-of"></a>
255+
256+
#### Uint16Array.of( element0\[, element1\[, ...\[, elementN]]] )
257+
258+
Creates a new typed array from a variable number of arguments.
259+
260+
```javascript
261+
var arr = Uint16Array.of( 1, 2 );
262+
// returns <Uint16Array>[ 1, 2 ]
263+
```
209264

210265
</section>
211266

lib/node_modules/@stdlib/array/uint32/README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,62 @@ var len = arr.length;
205205

206206
### Methods
207207

208-
TODO: add methods
208+
<a name="static-method-from"></a>
209+
210+
#### Uint32Array.from( src\[, map\[, thisArg]] )
211+
212+
Creates a new typed array from an array-like `object` or an iterable.
213+
214+
```javascript
215+
var arr = Uint32Array.from( [ 1, 2 ] );
216+
// returns <Uint32Array>[ 1, 2 ]
217+
```
218+
219+
To invoke a function for each `src` value, provide a callback function.
220+
221+
```javascript
222+
function mapFcn( v ) {
223+
return v * 2;
224+
}
225+
226+
var arr = Uint32Array.from( [ 1, 2 ], mapFcn );
227+
// returns <Uint32Array>[ 2, 4 ]
228+
```
229+
230+
A callback function is provided two arguments:
231+
232+
- `value`: source value
233+
- `index`: source index
234+
235+
To set the callback execution context, provide a `thisArg`.
236+
237+
```javascript
238+
function mapFcn( v ) {
239+
this.count += 1;
240+
return v * 2;
241+
}
242+
243+
var ctx = {
244+
'count': 0
245+
};
246+
247+
var arr = Uint32Array.from( [ 1, 2 ], mapFcn, ctx );
248+
// returns <Uint32Array>[ 2, 4 ]
249+
250+
var n = ctx.count;
251+
// returns 2
252+
```
253+
254+
<a name="static-method-of"></a>
255+
256+
#### Uint32Array.of( element0\[, element1\[, ...\[, elementN]]] )
257+
258+
Creates a new typed array from a variable number of arguments.
259+
260+
```javascript
261+
var arr = Uint32Array.of( 1, 2 );
262+
// returns <Uint32Array>[ 1, 2 ]
263+
```
209264

210265
</section>
211266

0 commit comments

Comments
 (0)