Computers are always work in binary numbers 1 and 0 but humans work with decimal and words. To create a communication between humans and computers we need some medium which can translate human’s instructions into computer’s and computer’s language into human’s. This is the point where programming languages come into play. Programming languages allow human to write computer instructions in human readable form So it can be translated into machine understandable format.
How to declare a variable
You can assign any value to the declared variable and you can change or update the value as well. Type of the variable depends on the value which you will assign to the variable. If you write
var name = “Khan”;
It will become string type variable, if you write
var age = 10
it will become integer type of variable.
You can declare boolean variable as well with
var myBoolean = true;
var myBoolean = false;
Add Strings variable
Add Integers variable
Declare two integer variables and add them with + operator.
Boolean variable can have only one of two values, it can be true or false. Create a variable called ourboolean and assign it value true.
To keep it very simple, compare two numbers, if first value is greatar than second value, ourboolean value will get true otherwise false.
Download file from GITHub