5.2 使用数组解构

eslint: prefer-destructuring jscs: requireArrayDestructuring

const arr=[1,2,3,4]

// bad
const first=arr[0]
const second=arr[1]

// good
const [first,second]=arr

results matching ""

    No results matching ""