Share:
Notifications
Clear all

Earn While Learning Web3 Programming>> Start Here FREE!!!

[Solved] Intro to Array In Solidity

1 Posts
1 Users
2 Reactions
537 Views
1
Topic starter

What Is Array In Solidity?

 

 

1 Answer
1
Topic starter

Arrays are used to put together multiple data types in a single variable in solidity. Similar to creating a list.

 

//no array

uint number1 = 1;

uint number2 = 2;

uint number3 = 3;

uint number4 = 4;

uint number4 = 5;

 

can now be compressed into one array variable instead of five (5) variable declarations above.

//Array or list

uint[] numbers = [1, 2, 3, 4, 5]; //dynamic array with 4 indexes

 

Want to learn more? see below:

 

NOTE:

This Is An Extract From Our FREE Smart Contract Development With Solidity For Beginners Course (If you have not enrolled yet, you can join the course totally for FREE).

 

 

Share: