Comments in JavaScript
- Single Line Comments- Consist of a double forward slash (//) followed by the comment. For Example.
- Multiline Comments- Consist of one Forward Slash and an Asterisk (/*) and ends with one Asterisk and a Forward Slash (*/).
- //alert('Welcome to the first class of C# with JavaScript');
- /*alert('Welcome to the first class of C# with JavaScript');*/
Case Sensitivity
- alert('Welcome to the first class of C# with JavaScript');
The preceding code works as usual and shows an alert box on the screen. But:
- Alert('Welcome to the first class of C# with JavaScript');
The same is the case of a variable as follows:
- var hello = "hello";
- alert (hello);
The preceding code shows the value of hello variable in the alert box. But:
- var hello = "Hello";
- alert (Hello);
Data Types in JavaScript
There are the 3 major types of variables in JavaScript:
- Numbers = 10, 10.23
- Boolean = True/False
- String = 'Welcome',"Welcome"
The data types are dynamically converted at the runtime depending on the value stored in them.
A variable is declared using a "var" keyword as follows:
- var a = 10;


Karthik Muthu KaruppanPosted Apr 29, 2015, 2:12 PM EDT
Good one
Nihal AhmedPosted Apr 29, 2015, 1:12 AM EDT
nice one
Sibeesh VenuTOP 100Posted Apr 28, 2015, 10:21 PM EDT
Good One
Rahul Kumar SaxenaTOP 100Posted Apr 28, 2015, 9:11 PM EDT
Good one
Nanhe SiddiquePosted Apr 28, 2015, 8:22 PM EDT
Nice Explanation Strategy