DART vs JavaScript

DART vs JavaScript: DART is a relatively new programming language compared to JavaScript. DART started around 2011 whereas JavaScript stared around 1995. DART has cherry-picked lot of features from other popular languages like JavaScript, C#, Erlang, Smalltalk, Strongtalk etc.

dart-vs-js

If you are trying to get into DART and you some knowledge in JavaScript, then you are in right place keep reading.

Difference: DART vs JavaScript

DifferenceDARTJavaScript
main functionIn DART you need to have a "main" function from where the execution begins. The main function is the entry point of the executionIn JavaScript, there is no concept of main Function, program execution begins at the first line of the file
Semicolon;Semicolon is mandatory of each end of statementSemicolon is optional
function keywordNo "funcuction" keyword. to declare a function no need to write function keyword in-front of itfunction keyword is mandatory for declaring a function
forEach loopwith "in" operator
for(int food in foods){
print(food);
}
with "of" operator
for(let food of foods){
console.log(food);
}

If you want to add something here  please comment below

Pros and Cons: dart vs js

DARTJavaScript
CON : Browsers doesn't understands DART, need to compile to JS to run in browserPros : All modern browser naively understands JavaScript
CON : As relatively new so less support is available in the internetPros: There are tons of help available in the internet

If you want to add something here  please comment below

Use DART online compiler to execute your dart programs

DART wiki

JavaScript wiki

 

Leave a Reply

Your email address will not be published. Required fields are marked *