CodesJava

Easy learning with example program codes

javascript operators tutorial

Operator:

Operator is a special symbol used for performing a specific task. e.g. A+B. Here + symbol represents the operator.

Types of javascript operators:

 
Example:

<!DOCTYPE html>
<html>
<body>
  <h2>JavaScript Operators Test</h2>
  <script>
	var num1 = 5, num2 = 10, num3 = 15;
 
	document.write(num1+num2);
      	document.write("</br>");
      	document.write(num2-num1);
      	document.write("</br>");
      	document.write(num1*num2);
      	document.write("</br>");
        document.write(num2/num1);
      	document.write("</br>");
        document.write(num1%2);
     	document.write("</br>");
      	num3++;
        document.write(num3);
      	document.write("</br>");
      	num2--;
        document.write(num2);
    </script>
</body>
</html>

Output:

JavaScript Operators Test
15
5
50
2
1
16
9
Please follow and like us:








Copyright © 2019 CodesJava DMCA.com Protection Status