一、typeof语法为typeofdata,可能返回number,boolean,string,object,undefined,functiontypeof"John"// Returns stringtypeof3.14// Returns numbertypeoffalse// Returns...
分类:
其他好文 时间:
2014-08-18 01:30:53
阅读次数:
262
//动态原型模式function Box(name,age){ this.name = name; this.age = age; this.family = ['哥哥','姐姐','妹妹']; if(typeof this.run != 'function'){ ...
分类:
其他好文 时间:
2014-08-17 18:17:42
阅读次数:
176
整个jQuery是一个自调用的匿名函数: 1 (function(global, factory) { 2 if (typeof module === "object" && typeof module.exports === "object") { 3 module.exp...
分类:
Web程序 时间:
2014-08-15 23:42:49
阅读次数:
300
1、NaN(not a number)非数字、不和任何数字相等,包括自己本身,可以用isNaN()判断,当praseInt()和praseFloat()不能解析时返回NaN。NaN为number对象下的一个属性,number.NaN typeof(NaN) //return number Na...
分类:
Web程序 时间:
2014-08-15 12:31:48
阅读次数:
241
(function($){
$.formatDate = function(pattern,date){
//如果不设置,默认为当前时间
if(!date) date = new Date();
if(typeof(date) ==="string"){
if(date=="") date = new Date();
else date = new Date(d...
分类:
Web程序 时间:
2014-08-14 23:56:46
阅读次数:
463
一直以来对于lock关键字的用法都存有疑惑,也从网上看到很多关于他的资料包括MSDN,无奈MSDN讲述的真是让人上火。今天决定小小研究一下一直都知道lock是锁定某一变量从而实现对某一代码段的独占执行。但是对于lock(this)、lock(typeof(类名))、lock(字符串)、lock(公有...
分类:
其他好文 时间:
2014-08-14 20:21:09
阅读次数:
231
判断js中的类型:typeof / instanceof / constructor / prototype对比总结...
分类:
Web程序 时间:
2014-08-14 14:08:48
阅读次数:
244
注:此文均来自网上,可行,只供参考//JAVASCRIPT中 日期相减很麻烦 ,现在有现成的实现方法,拷贝过去就可以用了,方便//调用该方法(主方法)function dateDiff(date1, date2){ var type1 = typeof date1, type2 = typeof d...
分类:
Web程序 时间:
2014-08-13 12:47:36
阅读次数:
246
js判断undefined类型 ??? if (reValue== undefined){ ??? alert("undefined"); ??? } ? 发现判断不出来,最后查了下资料要用typeof 方法: if (typeof(reValue) == "undefined") {? ?? alert("undef...
分类:
Web程序 时间:
2014-08-12 17:44:05
阅读次数:
214
这个程序看到几点: 1 TypeOf和ValueOf是获取Type和Value的方法 2 ValueOf返回的<float64 Value>是为了说明这里的value是float64 3 第三个b的定义实现了php中的string->method的方法,为什么返回的是reflect.Val...
分类:
其他好文 时间:
2014-08-12 14:01:44
阅读次数:
234