2017年8月4日

摘要: 1.let命令: 相当于var,声明的变量只在所在的代码块内有效,eg: { let a = 1; var b =2; console.log(a) //1 } console.log(a) //not defined console.log(b) //2 let变量在域解析的时候不会被提升,eg: 阅读全文
posted @ 2017-08-04 18:03 77小仙女呀 阅读(103) 评论(0) 推荐(0)

2017年7月28日

摘要: 1.Math 2.Date 3.Array 4.string 5.number 6.boolean length属性:长度 concat 方法(String)连接两个或更多个字符串。 indexOf(string) 返回出现字符串的位置 substr(num1,[num2])截取字符串 toLowe 阅读全文
posted @ 2017-07-28 16:00 77小仙女呀 阅读(187) 评论(0) 推荐(0)

2017年7月27日

摘要: 1.变量的作用域 首先作用域分为:局部作用域和全局作用域 函数内部是可以直接读取全局变量的 链式作用域:子对象会一级一级的向上寻找所有父对象的变量,所以所有父对象的变量对子对象是可见的。 2.闭包 闭包就是能够读取其他函数内部变量的函数。(如f2这个函数) function f1(){ var n= 阅读全文
posted @ 2017-07-27 17:29 77小仙女呀 阅读(88) 评论(0) 推荐(0)

2017年7月26日

摘要: 1.使用call或apply绑定构造函数 animal.apply(this.arguments) 2.使用prototype属性 Cat.prototype = new Animal(); Cat.prototype.constructor = Cat; var cat1 = new Cat("大 阅读全文
posted @ 2017-07-26 15:17 77小仙女呀 阅读(377) 评论(0) 推荐(0)