|
|
|
|
|
by gitgud
1662 days ago
|
|
Sorry I should have been more clear. Incrementing every element in an array is much less useful than ".map()" which can execute a function on every element. It just seems like a weirdly specific syntactic sugar... which is a "language smell"... to me |
|
e.g.:
arr1[] += arr2[] / 10.0 + 5;
TBH, I don't use this feature much, because I work with ranges more than arrays, which do not have this ability. This feature predates ranges (and the std.algorithm.map function, which can do what you say as well).