remember that i am not intending to make the deep course of theory only.
but later i felt that some basics was essential. so i am doing this theories in a very short way by assuming that you are already familiar with some programming language before (say C++).
Literals-> they are same as literals of C++ i.e they are constants. for eg-: 10,20, etc are literals.
so, let’s see a program that uses the concepts of variables.
its source code is given as below.
var one = 22;
var two = 3;
var add = one + two;
var minus = one - two;
var multiply = one * two;
var divide = one/two;
document.write("First No: = " + one + "<br />Second No: = " + two + " <br />");
document.write(one + " + " + two + " = " + add + "<br/>");
document.write(one + " - " + two + " = " + minus + "<br/>");
document.write(one + " * " + two + " = " + multiply + "<br/>");
document.write(one + " / " + two + " = " + divide + "<br/>");
and its output will come as follows.
<br> tag is used for line breaks.
+ operator is not used for adding but for making sure that sth is still to come. you can notice it if you look at all of them.
so, now let’s move ahead towards another topic.
Operators->operators are used to manipulate data and gives a data as result.
// for single line and /* for mutlitple line comments*/
likewise same rules apply for variable names i.e no hyphens
for eg-: var x-t //error
so, today’s lecture has been completed. don’t think that this is a bad tutorial, because our main target is to make projects and not to learn theory.
i assume you have learnt programming before, and I just want to refresh your knowledge about this.