{ let arr=['hello','world']; let map=arr[Symbol.iterator](); //返回false时继续执行,true停止执行! console.log(map.next()); console.log(map.next()); console.log(map.next()); } { let obj={ start:[,,], end:[,,], [Symbol.iterator](){ let self=this; let index=; let a…
很多东西就是要细细的品读然后做点读书笔记,心理才会踏实- Javascript对象本质上就是键值对的集合(Hash结构),但是键只能是字符串,这有一定的限制. 1234 var d = {}var ele = document.bodyd[ele] = 'This is body'console.log(d['[object HTMLBodyElement]']) 上段代码的原意是将DOM节点作为对象d的键,由于对象只接受字符串,所以ele被自动转为[object HTMLBodyElement…
python学习笔记整理 数据结构--字典 无序的 {键:值} 对集合 用于查询的方法 len(d) Return the number of items in the dictionary d. 返回元素个数 d[key] Return the item of d with key key. Raises a KeyError if key is not in the map. If a subclass of dict defines a method _missing_() and key…
20145330第五周<Java学习笔记> 这一周又是紧张的一周. 语法与继承架构 Java中所有错误都会打包为对象可以尝试try.catch代表错误的对象后做一些处理. 使用try.catch语法,JVM尝试执行try区块中的程序代码.如果发生错误,执行流程会跳离错误发生点,然后比较catch括号中声明的类型,是否符合被抛出的错误对象类型,如果是,就执行catch区块的程序代码. 范例如下: import java.util.*; public class Average { public…