Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
None
-
None
-
128485ccdb4f1c6f1bf1ebea85c5bed749cacd7a e3b9726483cb7336aa54ae7d9455becbd148b2b6
Description
Hi,
simply copy/pasting an example from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
let arr = [ 3, 5, 7 ]; arr.foo = "hello"; for (let i in arr) { console.log(i); // logs "0", "1", "2", "foo" } for (let i of arr) { console.log(i); // logs "3", "5", "7" }
for...in puts the key in the variable you define in the for statement.
for...of puts the value in the variable you define in the for statement.
Having support for that would simplify some loops. Not greatly and easy to "workaround" but it would still be nice to have.
Attachments
Issue Links
- relates to
-
QTBUG-47735 ECMAScript 7 Support
- Closed