Last active
August 29, 2015 14:05
-
-
Save flarnie/4a88602622fe8f44a8d9 to your computer and use it in GitHub Desktop.
ES6 transpiler example: how webpack's es-6-loader transforms our ES6 code.
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
// ES6 syntax | |
postsCollection.each((post) => { | |
if (post.get('highlighted')) { | |
this.highlightedPosts.push(post); | |
} | |
}); | |
// The translated version output by webpack | |
var this$0 = this; | |
postsCollection.each(function(post) { | |
if (post.get('highlighted')) { | |
this$0.highlightedPosts.push(post); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment