Skip to content
/ what.js Public

👻 only 0.25 kb. what.js is a simple library to get the type of variables. enganced typeof function.

License

Notifications You must be signed in to change notification settings

hustcc/what.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

what.js

what.js what.js is a simple library to get the type of variables. enganced javascript typeof function.

Build Status npm npm npm

1. Install

npm install what.js

Then import it.

var what = require('what.js');

//or

import what from 'what.js';

Or import it with <script> tag.

<script type="text/javascript" src="what.min.js"></script>

2. Detail Usage

what({}); // 'object'
what({abc: 123}); // 'object'

what([]); // 'array'
what([123, 'abc']); // 'array'

what(function() {}); // 'function'
what(setTimeout); // 'function'

what(/^what\.js$/); // 'regexp'

what(new Date()); // 'date'

what(null); // 'null'
what(undefined); // 'undefined'

what('abc'); // 'string'
what(123); // 'number'
what(12.3); // 'number'

what(true); // 'boolean'
what(false); // 'boolean'

3. Test

git clone [email protected]:hustcc/what.js.git

cd what.js

npm install

npm test

4. LICENSE

MIT

About

👻 only 0.25 kb. what.js is a simple library to get the type of variables. enganced typeof function.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published