native-with-fallback

native js functions with fallback

Usage no npm install needed!

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

README

Native js functions with fallback

📦 Install

npm install native-with-fallback
yarn add native-with-fallback

When To Use

When users need to check the given value is number or find index of matching value in an array or find a matching value in the given array.

🔨 Usage

const {isInteger, findIndex} = require('native-with-fallback');

isInteger(5);

const normalArray = [1, 2, 3, 4, 5];
findIndex(normalArray, (value)=>value===2);

API

Property Description prams
isInteger check is given valus in number value
findIndex find index of a value array , predicate
find find a matching value array , predicate

Follow me on

twitter github