Skip to content

Commit 5e92601

Browse files
committed
Auto-generated commit
1 parent 29a04c0 commit 5e92601

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<details>
2525

26+
- [`074cbef`](https://github.com/stdlib-js/stdlib/commit/074cbef3f9d616c37c2be856a949e257481ff2fc) - **docs:** add note concerning broadcasting of nested array elements _(by Athan Reines)_
2627
- [`b079d65`](https://github.com/stdlib-js/stdlib/commit/b079d653226019925581555fdaf9aa927ec69c0e) - **feat:** add support for integer array indexing assignment _(by Athan Reines)_
2728
- [`96e896a`](https://github.com/stdlib-js/stdlib/commit/96e896a39be08912b2e06dfb6b671ec13d042412) - **feat:** add support for boolean array indices _(by Athan Reines)_
2829
- [`75d4f83`](https://github.com/stdlib-js/stdlib/commit/75d4f83cb85610d23a04dc21a03f8075f6d3665f) - **refactor:** update require and include paths _(by Athan Reines)_

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,24 @@ y[ '10:20' ] = [ 8, 9, 10, 11 ];
405405
// throws <Error>
406406
```
407407

408+
In order to broadcast a nested array element as one would a scalar, one must wrap the element in a single-element array.
409+
410+
```javascript
411+
var y = array2fancy( [ [ 1, 2 ], [ 3, 4 ] ] );
412+
413+
// Assign individual array elements:
414+
y[ ':' ] = [ 5, 6 ];
415+
var v = y[ ':' ];
416+
// returns [ 5, 6 ]
417+
418+
y = array2fancy( [ [ 1, 2 ], [ 3, 4 ] ] );
419+
420+
// Broadcast a nested array:
421+
y[ ':' ] = [ [ 5, 6 ] ];
422+
v = y[ ':' ];
423+
// returns [ [ 5, 6 ], [ 5, 6 ] ]
424+
```
425+
408426
### Casting
409427

410428
Fancy arrays support [(mostly) safe casts][@stdlib/array/mostly-safe-casts] (i.e., any cast which can be performed without overflow or loss of precision, with the exception of floating-point arrays which are also allowed to downcast from higher precision to lower precision).

0 commit comments

Comments
 (0)