@polkadot/util
Version:
A collection of useful utilities for @polkadot
18 lines (17 loc) • 365 B
JavaScript
/**
* @name isNumber
* @summary Tests for a JavaScript number.
* @description
* Checks to see if the input value is a valid number.
* @example
* <BR>
*
* ```javascript
* import { isNumber } from '@polkadot/util';
*
* console.log('isNumber', isNumber(1234)); // => true
* ```
*/
export function isNumber(value) {
return typeof value === 'number';
}