Skip to content

Instantly share code, notes, and snippets.

@Nathan-Nesbitt
Created May 10, 2020 20:28
Show Gist options
  • Save Nathan-Nesbitt/0c16b61715f0cd1223b8c5f9945a2776 to your computer and use it in GitHub Desktop.
Save Nathan-Nesbitt/0c16b61715f0cd1223b8c5f9945a2776 to your computer and use it in GitHub Desktop.
For In Loop
// Create an object car with some attributes //
var car = {
brand:"Honda",
year:2018,
kms:2500
};
// Loops through the attributes in the object
for (var attribute in car) {
console.log(attribute + ": " + car[attribute]);
}
@Nathan-Nesbitt
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment