type

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
44
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
721 B
Gives a single-word string description of the (native) type of a value, returning such answers as 'Object', 'Number', 'Array', or 'Null'.
1 contributor
Install type as a package?
Copied
npm i @bit/justin-capalbo.ramda.type
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
type (
val:*
) : String

Gives a single-word string description of the (native) type of a value, returning such answers as 'Object’, 'Number’, 'Array’, or 'Null’. Does not attempt to distinguish user Object types any further, reporting them all as 'Object’.

Example
R.type({}); //=> "Object"
     R.type(1); //=> "Number"
     R.type(false); //=> "Boolean"
     R.type('s'); //=> "String"
     R.type(null); //=> "Null"
     R.type([]); //=> "Array"
     R.type(/[A-z]/); //=> "RegExp"
     R.type(() => {}); //=> "Function"
     R.type(undefined); //=> "Undefined"
Argument
val: *

The value to test

Returns
String

Help and resources