摘要:
this的指向在函数定义的时候是确定不了的,只有函数执行的时候才能确定this到底指向谁,实际上this的最终指向的是那个调用它的对象。 例子1: function cat(){ var user = "I'm cat"; console.log(this.user); //undefined co 阅读全文
摘要:
内置对象 Math var result= Math.max(10,20,30,40); console.log(result); Date //获取年份 console.log(dt.getFullYear()); //获取月份 console.log(dt.getMonth()+1);//是0开 阅读全文