摘要: Date对象 var d = new Date(); console.log(d);//Tue Jun 07 2022 17:30:03 GMT+0800 (中国标准时间) var d = new Date(2015,10,3); console.log(d);//Sun Nov 15 2015 0 阅读全文
posted @ 2022-06-14 11:08 沁芷清芬 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 回调函数:将一个函数作为参数传递给其他函数 ​ function addOne(a) { ​ return a + 1; ​ } ​ function multiply2(a,b,c,callback) { ​ var arr = [],i; ​ for(i = 0; i <= 2; i++){ ​ 阅读全文
posted @ 2022-06-14 11:06 沁芷清芬 阅读(15) 评论(0) 推荐(0) 编辑
摘要: javascript 对象的结构 obj > foo.prototype >object.prototype >null function foo(){}; var obj1 = new foo(); obj.x = 1; obj.y = 2; foo.prototype.z = 3; //继承fo 阅读全文
posted @ 2022-06-14 11:03 沁芷清芬 阅读(57) 评论(0) 推荐(0) 编辑
摘要: javascript隐式转换 字符串类转数值型 var c = '12'; c=c*1; alert(typeof(c));//number alert(c);//12 alert(1 + "1");//11 alert('2' + 12);//212 x显示转换 当a为0,-0,NaN,‘’(空字 阅读全文
posted @ 2022-06-14 11:00 沁芷清芬 阅读(20) 评论(0) 推荐(0) 编辑