2010年5月4日
摘要: 如果想把a缺省值设为5,不能写成: function my(a=5){  xxx;}简单查了一下,有下面几种可以使用:function my(a){  alert(a||5); }function my(a){   a = typeof(a) == 'undefined' ? 5 : a; }function my(a){   if(typeof(a) == 'undefined'){ ... 阅读全文
posted @ 2010-05-04 02:33 夹子 阅读(475) 评论(0) 推荐(0) 编辑