Created
July 17, 2010 20:25
-
-
Save devongovett/479827 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__hasProp: true | |
yearsOld: {max: 10, ida: 9, tim: 11} | |
ages: for child, age of yearsOld | |
child + " is " + age | |
# compiles into this JavaScript, which will not work | |
var _a, _b, age, ages, child, yearsOld; | |
var __hasProp = Object.prototype.hasOwnProperty; | |
__hasProp = true; | |
yearsOld = { | |
max: 10, | |
ida: 9, | |
tim: 11 | |
}; | |
ages = (function() { | |
_a = []; _b = yearsOld; | |
for (child in _b) { if (__hasProp.call(_b, child)) { | |
age = _b[child]; | |
_a.push(child + " is " + age); | |
}} | |
return _a; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment