for...of doesn't seem to execute the body
See original GitHub issueExecuting the following program:
ask {
let mySum:float = 0
for(let price of itemPrices) {
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 return 0.
Issue Analytics
- State:
- Created 3 years ago
- Comments:20
Top Results From Across the Web
for...of - JavaScript | MDN - MDN Web Docs
An iterable object. The source of the sequence of values on which the loop operates. statement. A statement to be executed on every...
Read more >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
A single execution of the loop body is called an iteration. The loop in the example above makes three iterations. If i++ was...
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 >Depersonalization-derealization disorder - Mayo Clinic
Feelings of depersonalization and derealization can be very disturbing and may feel like you're living in a dream.
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:
@czerwinskilukasz1, how would you implement
forOf
function in AskScript? AskJSX is a reflection of that.If you find yourself in need of
run
, you might want to define your own function and then call it. Here’s a sample while implementation in AskScript (based on native implementation of call):