The for..of syntax has been introduced in ES6.
It's supposed to be supported since JDK9 as part of JEP 292.
However, when I run OpenJDK 10's jjs, I get an exception:
jjs> for (var foo of ['bar', 'baz']) { print(foo); }
ECMAScript Exception: SyntaxError: <shell>:1:13 Expected ; but found of
for (var foo of ['bar', 'baz']) { print(foo); }
^