JS存档
yihong0618 opened this issue · comments
关于箭头函数
const myFunc = (stuff) => { someArray.push(stuff) }
const otherFunc = (stuff) => someArray.push(stuff)
console.log(myFunc()) // --> logs undefined
console.logo(otherFunc()) // --> logs result of push which is new array length
const x = () => {} // Does nothing
const y = () => ({}) // returns an object
- js的字符串也是不可变类型,需要先转换成数组
- 关于转换和python基本一样
map 必须用set 而不能像python那样直接a[2] =3 赋值