askql: for...of doesn't seem to execute the body

Executing 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.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20

Most upvoted comments

Following our chat, this is how it should work for a string:

const word = 'Hello';
for(const letter of word) {
 log(letter);
}