Skip to content

Instantly share code, notes, and snippets.

@sparty02
sparty02 / gist:a73b4e9eeca1f633da38
Created May 5, 2015 03:02
babel-plugin-foreach
function forEachTransform (babel) {
var t = babel.types;
return new babel.Transformer('plugin-foreach', {
CallExpression: function (node, parent) {
var callee = node.callee;
if (callee.property.name === 'forEach') {
var arrayName = callee.object.name;