css3新特性
border-raduis box-shadow background-size cover/ contain;
过度 :transform : translate(50%,50%)
transition:width 2s ease 3s
动画: animation: run 2s ease 3s forwads
JSON
json.parse() 将字符串转化成json
json.stringify() 将json转化成字符串
拷贝
深拷贝
1利用递归
function clone(obj) {
let nobj = {}
for (const key in obj) {
if (typeof obj[key] == 'object') {
nobj[key] = clone(obj[key])
} else {
nobj[key] = obj[key]
}
}
return nobj
}
2,json方法
function clone2(obj) {
const str = JSON.stringify(obj)
const nobj = JSON.parse(str)
return nobj
}
cookie
document.cookie = 'name = cff'