Es lint更喜欢解构

问题描述 投票:0回答:1

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

const length = this.props.options.length;
reactjs eslint
1个回答
2
投票

语法是这样的:

const { length } = this.props.options
© www.soinside.com 2019 - 2024. All rights reserved.