babel-plugin-auto-argument
v0.0.2
Published
[](https://github.com/HuQingyang/babel-plugin-auto-argument) [And it will be compiled to:
[1, 2, 3].map(function (_) {
return _ * 2
})In your js file:
const a = [
[1, 2],
[3, 4, 5],
[6, 7, 8, 9]
].filter(_.length <= 3).map(_.filter(10 % _ === 0));
console.log(a);And it will print:
[
[1, 2],
[5]
]3. Usage with custom variable name
Edit your .babelrc file:
{
"plugins": [
"auto-argument",
{
"variableName": "$"
}
]
}In your js file:
[1, 2, 3].map($ * 2)