5

node.js数组中多个对象怎么解构

 2 years ago
source link: https://learnblockchain.cn/question/2270
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
node.js数组中多个对象怎么解构 | 登链社区 | 技术问答

node.js数组中多个对象怎么解构

var a = [
BigNumber { _hex: '0x2386f26fc10000', _isBigNumber: true },
BigNumber { _hex: '0x188efa', _isBigNumber: true },
BigNumber { _hex: '0x0a47efb39fde6e', _isBigNumber: true }
]

数组a中有3个BigNumber对象

var b =a[0];
b.toString
上面这种分2次可以解构

a[0].toString
这样一次性解构不出来,请问应该怎么解;


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK