【发布时间】:2019-04-20 10:38:00
【问题描述】:
我正在使用以太坊和 react 构建签到应用程序。
checkin有placeid和username,我想按id过滤数组。
现在,我的代码是这样的
{ this.props.checkins.map((checkin, key) => {
return(
<div key={key}>
<p>ID{checkin.placeid}, Address:{checkin.username}</p>
</div>
)
})}
请给我一些建议。
【问题讨论】:
-
不需要特殊的魔法,只需简单的旧数组
filter方法。 developer.mozilla.org/fr/docs/Web/JavaScript/Reference/…