标准库,
js内存里两种stack栈内存,heap堆内存
stack重要变量global/window,window是hash表,里有两部分:标准库和非标准库
标准库:object(key属性,create方法)string()Number()array()Boolean()Array()Function()

加上new,就会变成string对象,没有new,就变成字符串
5个false值
0.NaN `` Undefined null,其他都是true
js的七种数据结构

生成了长度为3的数组
a[0]是undefined,0123没有存下来,只有length和proto

array(3),对应的length:3
array(3,3),对应前两项,第一项不是length
numble string boolean 不加new,number()=》基本类型
new number()=>返回对象(复杂类型
object(1)=>对象
new object(1)=》对象
加不加new都一样
···························
function小写是关键字 声明一个函数
Function 是全局对象,window.Object window.Function
new Function()
对象.proto=== 函数.protype
伪数组,原型链中没有array.prototype
js中伪数组arguments

a.forEach( function(x,y){
})

接受一个函数,强制代入3个参数
foreach

x一定是value,y一定是index,第一个参数一定是value
a.forEach在遍历什么?是a吗但是没有把a传进去,函数从哪里取a?
js其实传了2个参数,打aforEach(fn(){})等价于a,forEach.call
用this获取

直接遍历this,this等于obj

a.sort用法


foreach没返回值
map会遍历一次然后把函数操作的结果收集起来

网友评论