Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.
Showing posts with label types. Show all posts
Showing posts with label types. Show all posts

Javascript: Types of Operators



1. Arithmatic Operators :-

1. +(Addition)
2. -(Subtraction)
3. *(Multiplication)
4. /(Division)
5. %(Modules)
6. --(Returns the value then Increment)
7. ++(Returns the value then Decrement)

2. Logical Operators :-

1. &&(Logical AND)
2. ||(Logical OR)
3. !(Logical NOT)


3. Comparison Operators :-

1. ==(Equality)
!=(Not Equal)
3. ===(Strictly Equal)
4. !==(Stricty not Eqaul)
5. <(Less than)
6. >(Greater than)
7. <=(Less than or Equalto)
8. >=(Greater than or Equalto)

4. Assignment Operator :-

=(Equality)

5. Conditional Operator :-

The coditional operator ? and : are sometimes called ternary operators since they take three operand the condition is to be evaluated two alternative values to be written depending on truth or false of the condition.

Synatx:
condition?value1 : value2

6. Special Operator :-

1. Delete Operator: The delete operator is used to delete a object or a element of a array index.

2. New Operator: To create a new object of a type array and assign this array a memory.

Example:
myarray=new Array();

Javascript: Type of Variable



Javascript consist of four types of Variable.

1. Integer: Number consist of integer and floating values.
2. String: A string user sequence of 1 or more than 1 characters that are enclosed by doublequotes(" ") or singlequotes(' ').
3. Bool: Boolean consist of Logical values i.e. True or False.
4. Null: Null consist of single value. Null which identifies null, empty or not existing reference.



Example:

<html>
<head>
<titleTypes of Variable</title>
</head>
<body>

<script language="javascript">
var intval=30;
var floatval=8.50;
var stringval="Hello";
var booleanval=true;
document.write("Integer value = " + intval + "<br>");
document.write("Float value = " + floatval + "<br>");
document.write("String value = " + stringval + "<br>");
document.write("Boolean value = " + booleanval + "<br>");
</script>

</body>
</html>



OUTPUT

Integer value = 30
Float value = 8.5
String value = Hello
Boolean value = true

Google