Created
May 20, 2014 15:16
-
-
Save icebreaker/28f0af5fd0f613c0abc3 to your computer and use it in GitHub Desktop.
Waste or Not?
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
| class Iterate | |
| constructor: () -> | |
| @items = [11, 13, 15, 3] | |
| iterate1: () -> | |
| for item in @items | |
| console.log(item) | |
| iterate2: () -> | |
| for item in @items | |
| console.log(item) | |
| null |
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
| (function() { | |
| var Iterate; | |
| Iterate = (function() { | |
| function Iterate() { | |
| this.items = [11, 13, 15, 3]; | |
| } | |
| Iterate.prototype.iterate1 = function() { | |
| var item, _i, _len, _ref, _results; | |
| _ref = this.items; | |
| _results = []; | |
| for (_i = 0, _len = _ref.length; _i < _len; _i++) { | |
| item = _ref[_i]; | |
| _results.push(console.log(item)); | |
| } | |
| return _results; | |
| }; | |
| Iterate.prototype.iterate2 = function() { | |
| var item, _i, _len, _ref; | |
| _ref = this.items; | |
| for (_i = 0, _len = _ref.length; _i < _len; _i++) { | |
| item = _ref[_i]; | |
| console.log(item); | |
| } | |
| return null; | |
| }; | |
| return Iterate; | |
| })(); | |
| }).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment