Share:
Notifications
Clear all

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

[Solved] JavaScript Vs Solidity: Full List of Differences Between JavaScript and Solidity - Web3 Programming

4 Posts
3 Users
4 Reactions
613 Views
1
Topic starter

EXERCISE: Read and Research Beyond This Course About Differences between JavaScript and Solidity:
i. Post 1 differences between JavaScript and Solidity in this forum:

(NOTE: please, don't repeat what has been posted and use the numbering.

For example if the last post answer was (5), yours should be (6) and so on.

This will help ensure we have helpful non repetitive collection of full list of differences between JavaScript and Solidity)

 

 

NOTE:

This Is An Exercise 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).

 

3 Answers
1
Topic starter

(1) Variable Declaration:

Example 1:

JavaScript number variable is declared something like this:

var number = 1;

While the same number variable will be declared in Solidity as:

uint number = 1;

 

Another Example

Example 2:

JavaScript string variable is declared something like this:

var fullName = "Solomon Foskaay";

While the same string variable will be declared in Solidity as:

string fullName = "Solomon Foskaay";

 

Another Example

Example 3:

JavaScript negative number variable is declared something like this:

var negativeNumber = -25;

While the same negative number variable will be declared in Solidity as:

int negativeNumber = -25;

 

 

1
  1. JavaScript is a language that's iterpreted just-in-time. It is most famous for frontend applications and executed in the browser, but also used for backend applications such as NodeJS and Adobe Acrobat.
  2. Solidity is a high level language.  It gets compiled (not interpreted) and usually deployed on Blockchains that understand the Ethereum Virtual Machine (EVM). Once the code is compiled and deployed it is running as Smart Contract and one can interact with it.
Solomon Foskaay Solomon Foskaay Topic starter 28/10/2021 5:46 am

@leouloko ✔️100%👍

Kudos on your course progress 

1

3. Javascript can run on web browsers but solidity cannot  4. Javascript is an untyped  programming languague but solidity is a typed programming language. 5.Javascript files are saved on .Js extension while Solidity is saved on .sol extension

Share: