【问题标题】:Es lint prefer destructuringEslint 更喜欢解构
【发布时间】:2018-03-05 10:41:10
【问题描述】:

我不知道如何使用es6对象解构来存储数组的长度:

const length = this.props.options.length;

【问题讨论】:

标签: reactjs eslint


【解决方案1】:

语法是这样的:

const { length } = this.props.options

【讨论】:

    猜你喜欢
    • 2019-11-13
    • 2019-11-22
    • 1970-01-01
    • 2018-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-27
    相关资源
    最近更新 更多