Web3js教程

web3.js – underscore JS库

Web3.js附带了underscoreJS库,可用于操作JavaScript数组或对象。
示例
app.js
const Web3 = require('web3')
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_API_KEY') // YOUR_INFURA_API_KEY替换为你自己的key
// 访问underscore JS库
const _ = web3.utils._
_.each({ key1: 'value1', key2: 'value2' }, (value, key) => {
  console.log(key)
})
运行app.js
$ node app
输出
key1
key2
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4