1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
jashkenas--coffeescript/documentation/js/object_comprehensions.js

16 lines
348 B
JavaScript
Raw Normal View History

2010-10-04 23:21:16 -04:00
var _result, age, ages, child, yearsOld;
2010-07-29 00:51:35 -04:00
var __hasProp = Object.prototype.hasOwnProperty;
yearsOld = {
max: 10,
ida: 9,
tim: 11
};
ages = (function() {
2010-10-04 23:21:16 -04:00
_result = [];
for (child in yearsOld) {
if (!__hasProp.call(yearsOld, child)) continue;
age = yearsOld[child];
2010-09-21 23:58:05 -04:00
_result.push(child + " is " + age);
2010-07-29 00:51:35 -04:00
}
2010-09-21 23:58:05 -04:00
return _result;
2010-07-29 00:51:35 -04:00
})();