Overview of JavaScript

Introduction

 
JavaScript is a client-side scripting language basically used for validation. JavaScript at first used by Netscape Navigator. It is used to make well applications 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
  1. <script language=” JavaScript”>  
  2. ------------------------------  
  3. --------------------------------  
  4. </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