dom
2018-05-14 本文已影响0人
jh2k15
每次操作dom都会导致
页面重绘,重新渲染
数据类型
Number String Boolean Null Udefined
Object function
symbol
pop shift unshif push splice reverse sort
indexOf lastIndexOf
concat slice
forEach filter map filter some every reduce
find includes
let arr=[1,2,3]
arr.b=100
for(let i=0;i<arr.length;i++){
console.log(arr[i])
}
arr.map((item)=>{
console.log(item)
})
for(let key in arr){
console.log(typeof key)
console.log(key)
}
for(let value of arr){
console.log(value)
}
let obj={
name:'jh',
age:15
}
for(let key in obj){
console.log(`${key} : ${obj[key]}`)
}
for(let value of Object.values(obj)){
console.log(value)
}