Overview of JavaScript

JavaScript is a client side scripting language basically used for validation. JavaScript at first used by netscape navigator. It is used to make well application fast. JavaScript is a case sensitive language.


JavaScript can be used in three ways

  1. Internal JavaScript
  2. Inline JavaScript
  3. External JavaScript

Syntax of JavaScript

<script language=” JavaScript”>
------------------------------
--------------------------------
</script>

Output

Document.write(); or
Document.writeln();

Data types in JavaScript

  1. String
  2. Number
  3. Boolean
  4. Array
  5. Object
  6. Null
  7. Undefined

Variables in JavaScript

JavaScript variable can be assign with var keyword or without var keyword.

Like- var x; or x;

Example



Output : hello c# corner

Conditional statement

If-else



Switch statement



Looping in JavaScript



Output


Array in JavaScript



Output : 10,c#corner,10.50,true,sanjay

 

Ebook Download
View all
Learn
View all