for...in doesn't seem to execute the body
See original GitHub issueExecuting the following program:
ask {
let mySum:float = 0
for(let index in itemPrices) {
const price = itemPrices:at(index)
mySum = mySum:plus(price)
}
mySum
}
should lead to an error as itemPrices
does not exist and is not defined as resource or value either.
Instead, this program returns 0.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
For Loop not executing - Stack Overflow
The body of the loop will only execute when the condition is true. ... The reason the loop doesn't execute is mentioned by...
Read more >Loops: while and for - The Modern JavaScript Tutorial
Executes once upon entering the loop. condition, i < 3, Checked before every loop iteration. If false, the loop stops. body, alert( ...
Read more >Loops: while(), for() and do .. while() - Physics and Astronomy
If the condition is false the body of the loop never executes at all. ... sense while() loops are a bit more complicated...
Read more >4. Conditionals and loops — Beginning Python Programming ...
Each item in turn is (re-)assigned to the loop variable, and the body of the loop is executed. The general form of a...
Read more >Loops in JavaScript - performing repeated operations on a ...
These loops execute the loop's body (the block) for as long as the condition remains truthy. We use the term one iteration to...
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
Following our chat, this is how it should work for a string:
Same as for-of. This should also work for strings I think