【文件属性】:
文件名称:oftype:用于检查变量运行时类型的 JavaScript 模块
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-29 07:52:08
JavaScript
类型
用于检查变量运行时类型的 JavaScript 模块
用法
var oftype = require ( 'oftype' ) ;
var x = 123 ;
var y = true ;
var z = / abc / ;
var u = undefined ;
var n = null ;
function Obj ( ) {
this . name = 'ABC' ;
}
var o = new Obj ( ) ;
//check if variable x is of Number type.
oftype ( 123 , Number ) ; //true
//check if variable y is of Boolean type.
oftype ( y , Boolean ) ; //true
//check if variable z is of Reg
【文件预览】:
oftype-master
----.travis.yml(85B)
----LICENSE(1KB)
----test()
--------oftype-test2.js(347B)
--------oftype-test4.js(323B)
--------oftype-test3.js(483B)
--------oftype-test.js(2KB)
--------oftype-test5.js(493B)
----README.md(2KB)
----oftype.js(1KB)
----.gitignore(26B)
----package.json(596B)