HTML Online Tutorial Contents

Following are the posts for HTML online Tutorial. To learn everything about HTML, just read these posts: HTML Online Tutorial HTML TAGS (2) HTML BASICS (3) HTML ELEMENTS (4) HTML ATTRIBUTES (5) More »

XHTML

XHTML stands for Extensible Hypertext Markup Language. It is also known as XML (Extensible Markup Language). It is a markup language. In XHTML, there are no predefined tags. The user defines the More »

HTML SUMMARY

In this tutorial, you learned: HTML Introduction HTML Tags HTML Basics HTML Elements HTML Attributes HTML Paragraphs HTML Headings HTML Formats HTML Image HTML Links HTML Lists HTML Frames HTML Table After More »

HTML TABLES (13)

HTML Tables are used to arrange data in web pages. HTML allows the use of tables by <table>…</table> tags. Each row in HTML table is recognized by <tr>…</tr> tag. In each row More »

HTML FRAMES (12.2)

Nested frames example: For the following example to work, there are two other simple HTML files : “HMTL11e1 frame a.html” and “HMTL11e1 frame b.html”. your browser will divide your screeub half. The More »

 

Tag Archives: JavaScript syntax

Learn how to use JavaScript Comments, JavaScript Literals and JavaScript Identifiers:

Learn how to use JavaScript Comments, JavaScript Literals and JavaScript Identifiers:

First we will introduce you to comments style of this language. Mostly the comments style is same in some languages. You don’t mix the comment styles of various languages, it is necessary for you to know about how to write comments in JavaScript.

JavaScript Comments:

There are two styles of comments which are supported by JavaScript. First style is the one in which any text that you may put in between // and the end of each line is considered as a comment by JavaScript. This style is also known as Single Line Comment. Therefore this text is ignored by JavaScript. In the second style any text between /* & */ will be considered as a comment and will be ignored as well. You can use this style to enter paragraphs of comments in the code. Following are some examples of JavaScript comments:

//This is a first style of comment

/* This is a second style of comment */

/*You can enter the paragraphs of comment like this in your code.

*This style can be used to provide introduction of your program

*Or this style can be used to explain each instruction in your code.

*/

JavaScript Literals:

Any data which will appear directly in a program is known as a Literal. For your understanding we have provided various examples which are:

“i am a literal”                // A string of text

1989                               //The number is 1989

true                                // A Boolean value

null                                 // shows an absence of an object

{2,5,7,8,9,1,5,7,5}          //This is a way to initialize an Array

JavaScript Identifiers:

The identifier is basically a name. The words which are used to name variables, functions and labels of loops in JavaScript are known as Identifiers. You must remember that the identifier must start with a letter, dollar sign ($) or an underscore (_). The succeeding characters can be digits, letters, dollar sign or even underscore. You must remember that digits cannot be used as a first character of identifier. This rule exists so that JavaScript can differentiate between numbers and identifiers. You should notice the following legal identifiers:

you

i_am_blog

exercise14

_what is an identifier

$your

To make the code editing easy and portability the ASCII characters are usually used as in identifiers. But what if you want to use a mathematical symbol as a variable! To solve this problem, you can use letters and digits from an entire Unicode set in identifiers. Due to this, you can also use variables names from non-English languages. Following is example of mathematical symbol identifier:

var π = 3.14;

var ∑ = 4.2;

In this post, you have learned about comments, literals and identifiers in JavaScript. To Learn more about JavaScript subscribe to our RSS feed and newsletter and you will be expert in JavaScript in no time.

To get a mobile app for your business visit www.codescamp.com

Book a free consultation today!