Created
July 17, 2019 04:11
-
-
Save stephenquan/78ba570f2104624e08f0148aeb72e4bb to your computer and use it in GitHub Desktop.
AppStudio_20190717_ForOfDest.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.12 | |
import QtQuick.Controls 2.5 | |
Item { | |
Button { | |
text: qsTr("Run For Of With Destructuring 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 ) { | |
let { country, population } = item | |
console.log( country, population ) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment