js 类型判断函数

function isNumber(s){
	return !isNaN(s);
}
function isString(s){
	return "string"==typeof s;
}
function isBoolean(s){
	return "boolean"==typeof s;
}
function isFunction(s){
	return "function"==typeof s;
}
function isNull(s){
	return s==null;
}
function isUndefined(s){
	return "undefined"==typeof e;
}
function isEmpty(s){
	return /^\s*$/.test(s);
}
function isArray(s){
	return s instanceof Array;
}

 

posted @ 2012-02-23 11:32  码农13  阅读(693)  评论(0编辑  收藏  举报