babel-plugin-for-length-optimizer

This is example plugin that brings a small "for length" optimization.

Usage no npm install needed!

<script type="module">
  import babelPluginForLengthOptimizer from 'https://cdn.skypack.dev/babel-plugin-for-length-optimizer';
</script>

README

babel-plugin-for-length-optimizer

This is example plugin that brings a small "for length" optimization.

It converts code below:

for (let i = 0; i < array.length; i++) {
  ...
}

to:

for (let i = 0, _len = array.length; i < _len; i++) {
  ...
}

Tested and is working properly with Babel 7.x