Int[] list := [1, 2, 3, 4]
Int? t := null
while (null != (t = list.find { it == 2 })) {
echo(t)
list.remove(t)
}
In Java, it works as intended (prints 2 and finishes). In JS, it prints true in an infinite loop. It's because in JavaScript the while loop looks like this:
dsav Tue 26 Apr 2011
Please, consider the following code:
In Java, it works as intended (prints 2 and finishes). In JS, it prints
true
in an infinite loop. It's because in JavaScript thewhile
loop looks like this:(parenthesis omitted).
andy Tue 26 Apr 2011
Promoted to ticket #1508 and assigned to andy