jashkenas--coffeescript/documentation/js/object_comprehensions.js

17 lines
378 B
JavaScript
Raw Normal View History

(function(){
2010-02-21 16:45:03 +00:00
var _a, _b, age, ages, child, years_old;
2010-01-14 04:24:45 +00:00
var __hasProp = Object.prototype.hasOwnProperty;
years_old = {
max: 10,
ida: 9,
tim: 11
};
ages = (function() {
2010-02-21 16:45:03 +00:00
_a = []; _b = years_old;
for (child in _b) { if (__hasProp.call(_b, child)) {
age = _b[child];
_a.push(child + " is " + age);
}}
return _a;
2010-01-25 05:14:00 +00:00
}).call(this);
})();