array-firstof

Get first value of array.

Usage no npm install needed!

<script type="module">
  import arrayFirstof from 'https://cdn.skypack.dev/array-firstof';
</script>

README

array-firstof

NOTE: array-firstof was renamed to @extra-array/first. NPM

Get first value of array.

const firstOf = require('array-firstof');
// firstOf(<array>, [index=0])

firstOf(['g', 'a', 'r', 'f', 'i', 'e', 'l', 'd']);
// 'g'
firstOf(['o', 'd', 'i', 'e'], 2);
// 'i'