Sum expression in array element becomes array concatenation
See original GitHub issueSteps to reproduce
PS C:\windows\system32> @(1,2+3).length
3
Expected behavior
PS C:\windows\system32> @(1,2+3).length
2
Actual behavior
PS C:\windows\system32> @(1,2+3).length
3
Environment data
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Sum of the first M elements of Array formed by infinitely ...
Sum of the first M elements of Array formed by infinitely concatenating given array ; Input: arr[] = {1, 2, 3}, M =...
Read more >Add not Concatenate Objects in Array - javascript
I am trying to GET total order prices (in USD) in an object array and sum the total. Instead of summing the array,...
Read more >Sum of array elements - MATLAB sum
This MATLAB function returns the sum of the elements of A along the first array dimension whose size is greater than 1.
Read more >Array.prototype.reduce() - JavaScript - MDN Web Docs
A function to execute for each element in the array. Its return value becomes the value of the accumulator parameter on the next...
Read more >Work with arrays | BigQuery
With GoogleSQL, you can construct array literals, build arrays from subqueries using the ARRAY function, and aggregate values into an array using the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For clarity: the + operator is lower precedence than the , operator
so
1 , 2 + 3 , 4 , 5
reads as(1 , 2) + (3 , 4 , 5)
not as1 , (2 + 3) , 4 , 5
Oh I suppose that makes sense. Thank you.