@fabiospampinato/is-numeric

Checks if a variable represents a numeric value.

Usage no npm install needed!

<script type="module">
  import fabiospampinatoIsNumeric from 'https://cdn.skypack.dev/@fabiospampinato/is-numeric';
</script>

README

isNumeric

Checks if a variable represents a numeric value.

Install

$ npm install --save @fabiospampinato/is-numeric

Usage

import isNumeric from '@fabiospampinato/is-numeric';

isNumeric ( 3 ); // true
isNumeric ( '3' ); // true
isNumeric ( 2e+30 ); // true
isNumeric ( '2e30' ); // true

isNumeric ( Infinity ); // false
isNumeric ( NaN ); // false
isNumeric ( '__test__' ); // false
isNumeric ( '123test' ); // false

License

MIT © Fabio Spampinato