Skip to content

Instantly share code, notes, and snippets.

@hustKiwi
Last active September 21, 2019 09:59
Show Gist options
  • Save hustKiwi/2cb6a31d8b34a4660db6a991d585b669 to your computer and use it in GitHub Desktop.
Save hustKiwi/2cb6a31d8b34a4660db6a991d585b669 to your computer and use it in GitHub Desktop.
for (let i = 0; i < 5; i++) {
console.log(i);
}
let i = 0;
do {
console.log(i);
} while (++i < 5);
i = 0;
while (i < 5) {
console.log(i);
i++;
}
const car = {
size: 3,
wheel: 4
};
for (const prop in car) {
console.log(prop);
console.log(car[prop]);
}
const cars = ['a', 'b', car];
for (const index in cars) {
console.log(index);
console.log(cars[index]);
}
for (const value of cars) {
console.log(value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment