jquery中typeof的用法

版权声明:本文为作者原创,转载请注明出处,联系qq:32248827 https://blog.csdn.net/dataiyangu/article/details/84748594

typeof 可以用来检测给定变量的数据类型,可能的返回值:

  1. ‘undefined’
  2. ‘boolean’
  3. ‘string’
  4. ‘number’
  5. ‘object’
  6. ‘function’
			var hahaha = 'hello world';   
           alert(typeof hahaha);  // 'string'   
           alert(typeof hahaha);  // 'number'

猜你喜欢

转载自blog.csdn.net/dataiyangu/article/details/84748594