Thursday 17 November 2011

Features of javascript

      There are various features of javascript as given below.

·         Javascript is case sensitive.

Javascript is case sensitive so the  function named “myfun” is not the same as “myFun” and a variable named “myvar”  is not the same as “myvar”.

·         The symbols must be closed if opened.

There are symbols like ( { [ “ ‘ , such symbols if used should have the closing symbols like ) } ] “ ‘ .

·         White space is ignored.

White space is the category having space, tab, new line. this white space is ignored by the javascript.

     Example: x = 5;        Here the tab is ignored by the javascript

·         Insert special character.

You can insert special character like “ ‘ ; & by giving backslash in the document.

            Example : document.write(“Hello\& world”);


            Output: Hello& world


·         Comment

               Comment can be given for single line “//” slash is used.

               For multiple comments use “/*  */”

·         Ending statement with semicolon.

In javascript the semicolons are optional. But if we want that the text should be there in same line at that time semicolon is required.

Posted By : Hemangi Zala

No comments:

Post a Comment