Skip to content

Instantly share code, notes, and snippets.

@stephenquan
Created July 17, 2019 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephenquan/d46b30d122efd12ac81c9a90c8583f0a to your computer and use it in GitHub Desktop.
Save stephenquan/d46b30d122efd12ac81c9a90c8583f0a to your computer and use it in GitHub Desktop.
AppStudio_20190717_ForOf.qml
import QtQuick 2.12
import QtQuick.Controls 2.5
Item {
Button {
text: qsTr("Run For Of Sample")
onClicked: {
let census = [
{ country: "France", population: 66.99 },
{ country: "Australia", population: 24.6 },
{ country: "United States", population: 327.2 }
]
for ( let item of census ) {
console.log( item.country, item.population )
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment