Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Babel plugin assignment push

Important: Don't use it in production, is just proof of concept made for fun when i was learning how Babel plugins works :]

This plugin allows to use '+=' operator to push some element in a given array

Example:

const run = () => {
 const givenArray = [];
 for (let i = 0; i < 5; i++) {
 givenArray += i;
 }
 console.log("out", givenArray);
};
run();

Equivalent to:

const run = () => {
 const givenArray = [];
 for (let i = 0; i < 5; i++) {
 givenArray.push(i); //note that
 }
 console.log("out", givenArray);
};
run();

Test:

1 - git clone https://github.com/FrancinildoAlvelim/babel-plugin-array-assignment-push.git

2 - run npm install in the cloned directory

3 - npm test

About

Babel plugin assignment push

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /