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
- Internal JavaScript
- Inline JavaScript
- External JavaScript
Syntax of JavaScript
<script language=” JavaScript”>
------------------------------
--------------------------------
</script>
Output
Document.write(); or
Document.writeln();
Data types in JavaScript
- String
- Number
- Boolean
- Array
- Object
- Null
- 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