trim-withdeprecated

trim an array with a function for each element

Usage no npm install needed!

<script type="module">
  import trimWith from 'https://cdn.skypack.dev/trim-with';
</script>

README

trim-with

Functional array trimming: provide a function that decides whether a value is falsy, and this trims the array from both sides.

var trimWith = require('trim-with');

trimWith([0, 1, 0], function(element) {
  // removes falsy values from sides
  return !element;
});