1var person={
2 first_name:"johnny",
3 last_name: "johnson",
4 phone:"703-3424-1111"
5};
6for (var property in person) {
7 console.log(property,":",person[property]);
8}
1var myObj = {foo: "bar", baz: "baz"};
2Object.values(myObj).map((val) => {
3console.log(val);
4})
5// "bar" "baz"
1const object = {a: 1, b: 2, c: 3};
2
3for (const property in object) {
4 console.log(`${property}: ${object[property]}`);
5}
1for (var prop in obj) {
2 if (Object.prototype.hasOwnProperty.call(obj, prop)) {
3 // do stuff
4 }
5}
1for (var prop in obj) {
2 if (Object.prototype.hasOwnProperty.call(obj, prop)) {
3 // do stuff
4 }
5}
6