Solidity vs Javascript arrays

Julien Klepatch

Solidity arrays… are like Javascript arrays, right?

Nope..

In Solidity:

  • Arrays can only contain data of the same type (ex: arrays of integers, array of booleans, but not arrays of integers AND booleans..)
  • Arrays can be in storage, or in memory (persistent and non-persistent)
  • You can use the `push()` method to add elements ONLY for the storage arrays

I have created a short video tutorial with all the point above and many other tricks and tips for manipulating Solidity arrays.

Check it out, it’s free

By the way, in Dapp 30, where we create 30 smart contracts in Solidity where you will have a ton of practical experience manipulating arrays and advanced Solidity patterns. Check out the curriculum here.
 

0 Comments

Leave a Reply

More great articles

“Learn Ethereum Dapps” ebook updated: Refactor Dapp with React

I have just updated the ebook Learn Ethereum Dapps with 3 new chapters (step10, 11, and 12). In these chapters…

Read Story

The Smart contract 30 course is finished!

Finally! Smart contract 30 is finished! I have just published the last video of smart contract 30 on Solidity assembly.…

Read Story

Ethereum Tokens explained to Developers – Full Guide (9 tokens covered)

ERC this, ERC that... so many token standards... If you want to become good in Solidity, you HAVE to understand…

Read Story

Never miss a minute

Get great content to your inbox every week. No spam.
[contact-form-7 id="6" title="Footer CTA Subscribe Form"]
Arrow-up