摘要: 1.增强的对象字面量 function fn(){ return 100; } let name='sui'; let age=19; let sui={ name, age, ["pro"+fn()]:"sdfe", play(){ console.log("我会打大鱼") } }; consol 阅读全文
posted @ 2017-07-11 19:50 前端兵哥哥 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 同步 console.log(1); console.log(2); console.log(3); console.log(4); //异步 ajax 文件读取io操作 console.log(1); console.log(2); setTimeout(function(){ console.l 阅读全文
posted @ 2017-07-19 21:07 前端兵哥哥 阅读(1555) 评论(0) 推荐(0) 编辑
摘要: generators(生成器) 生成迭代器: def fib(max): a, b = 0, 1 while a for i in fib(1000): print(i) 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 f = fib(1000) f 阅读全文
posted @ 2017-07-18 21:30 前端兵哥哥 阅读(232) 评论(0) 推荐(0) 编辑
摘要: Iterator、for..of,for...in和自定义遍历器 Iterator: for..of,for...in: 普通数组遍历: 迭代器遍历: 数组 Set Map 自定义遍历器: var arr = [1,2,3,4,5]; function Iterator(arr){ let i = 阅读全文
posted @ 2017-07-18 21:21 前端兵哥哥 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 构造方法: class Student{ constructor (name,age){ this.name =name; this.age=age; } run(){ console.log("我会跑"); } } let xs = new Student("曹伟",22); console.lo 阅读全文
posted @ 2017-07-17 20:27 前端兵哥哥 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 一、理解对象: 第一种:基于Object对象 var person = new Object(); person.name = 'My Name'; person.age = 18; person.getName = function(){ return this.name; 第二种:对象字面量方式 阅读全文
posted @ 2017-07-16 22:11 前端兵哥哥 阅读(174) 评论(0) 推荐(0) 编辑
摘要: function fn(){ return 100; } let name='sui'; let age=19; let sui={ name, age, ["pro"+fn()]:"sdfe", play(){ console.log("我会打大鱼") } }; console.log(sui.n 阅读全文
posted @ 2017-07-16 14:05 前端兵哥哥 阅读(296) 评论(0) 推荐(0) 编辑
摘要: let a=1; let b=1; console.log(a==b); //结果:true let x=Symbol('this is x'); console.log(typeof x); //结果:symbol let y=Symbol('y'); console.log(x==y); //结 阅读全文
posted @ 2017-07-13 19:53 前端兵哥哥 阅读(266) 评论(0) 推荐(0) 编辑
摘要: “箭头”(= )定义函数。 let name='hello'; ()= { console.log('name'); }; (name)= { console.log(name); } ; let d= name= { console.log(name); }; (name,age)= { cons 阅读全文
posted @ 2017-07-12 19:27 前端兵哥哥 阅读(706) 评论(0) 推荐(0) 编辑
摘要: 第1节let // ES6 — let let a = 1; if (1 === a) { let b = 2; } for (let c = 0; c 阅读全文
posted @ 2017-07-11 10:01 前端兵哥哥 阅读(220) 评论(0) 推荐(0) 编辑