Javascript
1. two ways to iterate an array
var results = new Array();
//...
for (var i = 0; i < results.length; i++){
//...
//Only useful when the results is not built as an associative array, but a simple number-indexed array.
// results['1st'] = 111;
// results['2nd'] = 222;
// results.length is 0 actually.
}
for ( var tmp in results ){
// tmp is the key. results[tmp] is the value.
// When you use prototype of an object, you get them in this way
// e.g key is the function name, value is the function body...
// All are objects.
}