Skip to content

Instantly share code, notes, and snippets.

@hehongwei44
Created July 3, 2014 06:13
Show Gist options
  • Save hehongwei44/fca3f169ad547fc4ba5d to your computer and use it in GitHub Desktop.
Save hehongwei44/fca3f169ad547fc4ba5d to your computer and use it in GitHub Desktop.
判断传入的参数是否为数字
/**
*
* @descrition : 该函数的功能是判断转入的参数是否为数字类型。
* @param->o : 传入的参数,参数可以为任何类型。
* @return: true表示为数字,false为非数字
*
*/
var isNumber = function(o) {
return !isNaN(o);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment