Javascript tutorials #2

remember that i am not intending to make the deep course of theory only.

when i first thought of javascript tutorials, i had thought of giving only projects tutorials.

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++).

javascript is a programming language because it can take decisions whereas; html and css are not the programming language.

Literals-> they are same as literals of C++ i.e they are constants. for eg-: 10,20, etc are literals.

Variables-> var keyword is used to display variables in javascript. for eg var x denotes variable in javascript.

so, let’s see a program that uses the concepts of variables.

its source code is given as below.

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.



now, let’s discuss about comments in javascript. Comment as written in the same way as in C and C++.

// 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.

Be the first to comment

Leave a Reply

Your email address will not be published.