jashkenas--coffeescript/documentation/js/while.js

23 lines
418 B
JavaScript
Raw Normal View History

2009-12-21 16:41:45 +00:00
(function(){
2010-02-21 16:45:03 +00:00
var _a, lyrics, num;
// Econ 101
2010-01-14 04:24:45 +00:00
if (this.studying_economics) {
while (supply > demand) {
buy();
}
while (supply < demand) {
sell();
}
2009-12-21 16:41:45 +00:00
}
// Nursery Rhyme
2010-01-14 04:24:45 +00:00
num = 6;
lyrics = (function() {
2010-02-21 16:45:03 +00:00
_a = [];
2010-01-14 04:24:45 +00:00
while (num -= 1) {
2010-02-21 16:45:03 +00:00
_a.push(num + " little monkeys, jumping on the bed. \
2010-01-14 04:24:45 +00:00
One fell out and bumped his head.");
}
2010-02-21 16:45:03 +00:00
return _a;
2010-01-25 05:14:00 +00:00
}).call(this);
2010-02-24 23:27:10 +00:00
})();