Solidity vs Javascript arrays

jklepatch

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.
 

More great articles

What is Ethereum gas? Ultimate Guide For Solidity developers

Gas is a unit used in Ethereum transactions. It is one of the most difficult concept for Ethereum newbies who…

Read Story

Genesis Post | Episode 0

https://youtu.be/S4Q9T4EZjSs Hi and welcome to Eat The Blocks! My name is Julien Klepatch. I am a blockchain developer, and I…

Read Story

100+ video tutorials on Ethereum / Solidity development

EatTheBlocks Pro just reached a new milestone: there are now more than 100 videos on Ethereum & Solidity development. That's…

Read Story

Never miss a minute

Get great content to your inbox every week. No spam.

    Only great content, we don’t share your email with third parties.
    Arrow-up