Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
Array of key/value pairs?

I'm working with ethers.js and fetching data from a smart contract. When logging the response to the console, something along the lines of this gets logged:

0: BigNumber {_hex: '0x05', _isBigNumber: true}
1: "test test test"
2: "transfer(address, uint256)"
3: "data data data"
4: BigNumber {_hex: '0x01', _isBigNumber: true}
5: BigNumber {_hex: '0x61a4e4ae', _isBigNumber: true}
6: false
contractAddress: "test test test"
functionSignature: "transfer(address, uint256)"
id: BigNumber {_hex: '0x05', _isBigNumber: true}
params: "data data data"
voteAmount: BigNumber {_hex: '0x01', _isBigNumber: true}
voteFinishTimestamp: BigNumber {_hex: '0x61a4e4ae', _isBigNumber: true}
voteFinished: false

So it looks like the data is logged twice, once with the indices and then once more as key/value pairs. I'm extremely confused as to how this works. When Array.isArray() is called on this data structure, it returns true, yet it allows accessing the properties both through indices and through dot notation. So, data[6] will return the same thing as data.voteFinished. I don't understand what this array/object hybird is and how it's possible to access array properties through dot notation in this specific scenario. Any clarification would be great.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!