js单体内置对象:js的内置对象,是ECMAScritp提供的.不依赖于宿主环境的对象,我的理解就是在我们开发之前js里面就已经存在的对象.单体内置对象就是是不需要通过new来实例化的,例如我们的string可以new,但是Math是不要new的,因为可以直接使用Math的API. 一.Global 对象 Global 对象是JavaScript中的内部对象,该对象无法直接访问,其目的是将全局方法收集到一个对象中.我们直接使用该对象的属性和方法即可. 1.global对象的属性 属性 描述 In
Exceptional Exception Handling in JavaScript MDN资料 Anything that can go wrong, will go wrong. Murphy’s law is even applicable to software development. For non-trivial programs, it’s not a matter of if, but when something will go wrong. Stand
map:会根据提供的函数对指定序列做映射. map(func, *iterables) --> map object Make an iterator that computes the function using arguments from each of the iterables. Stops when the shortest iterable is exhausted. """ 根据提示,map有一个函数名参数还有个动态参数,意思是将可迭代的对象打散然后把
简单的记录下这两个函数的功能: list(filter(lambda x : x % 2, range(10))) 上例是返回了0-10之间的所有基数组成的列表.filter()有2个参数,第一个参数可以是一个函数或者None,第二个参数是一个可迭代的对象.如果filter函数的第一个参数是一个函数对象,那么,filter的作用就是将第二个参数的可迭代对象的每个结果作为第一个参数(函数)当中的参数值,计算出相应结果,并将所有结果为True的值组成一个可列表化的对象.如果filter函数的第一个参
数组Array 1创建方式 var colors = ['red','color','yellow']; var colors2 = new Array(); 2数组的赋值 var arr = []; //通过下标进行一一赋值 arr[0] = 123; arr[1] = '哈哈哈'; arr[2] = '嘿嘿嘿' 3数组的常用方法 3.1 数组的合并 concat() var north = ['北京','山东','天津']; var south = ['东莞','深圳','上海']; var