@jswork/one2extra

GGet one and extra.

Usage no npm install needed!

<script type="module">
  import jsworkOne2extra from 'https://cdn.skypack.dev/@jswork/one2extra';
</script>

README

one2extra

GGet one and extra.

version license size download

installation

npm install @jswork/one2extra

usage

import one2extra from '@jswork/one2extra';

const arr = [ 1, 2, 3 ];
const fn3 = (list)=> list.findIndex(item => item === 3);

one2extra(0, arr); // [1,[2,3]]
one2extra(1, arr); // [2,[1,3]]
one2extra(fn3, arr); // [3,[1,2]]

license

Code released under the MIT license.