@alu0101126692/constant-folding
v1.0.4
Published
Constant Folding javascript code
Downloads
17
Maintainers
Readme
constant-folding
Installation
npm i @alu0101126692/constant-folding
Usage as executable:
cf codigo.js -o output.js
Usage from code:
const constantFolding = require('constant-folding').constantFolding;
The documentation of the function.
Examples
cf code.js -o output.js
Author
alu0101126692 - Pablo Torres
Tests
✔ Concat ["a", "b", "c"].concat(["d", "e"], "f", "g", ["h"]); => ["a", "b", "c", "d", "e", "f", "g", "h"];
✔ Join vacio ["a", "b", "c"].join(); => "a,b,c";
✔ Join con simbolo ["a", "b", "c"].join("@"); => "a@b@c";
✔ Length [1, 2, 3].length; => 3;
✔ [1, 2, 3][2-1]; => 2;
✔ Shift [1, 2, 3].shift(); => 2;
✔ Slice [1, 2, 3].slice(0, 1+1); => [1, 2];
✔ Pop [a, b, c].pop(); => c;
✔ Reverse [a, b, c].reverse(); => [c, b, a];