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 arr = [ "one", "two", "three", "four", "five" ];
2var obj = { one:1, two:2, three:3, four:4, five:5 };
3
4jQuery.each(arr, function() {
5 $("#" + this).text("My id is " + this + ".");
6 return (this != "four"); // will stop running to skip "five"
7});
8
9jQuery.each(obj, function(i, val) {
10 $("#" + i).append(document.createTextNode(" - " + val));
11});