Javascript tutorial - 2 - Concatenation
Dave Partner

Javascript tutorial - 2 - Concatenation

  • 0 Replies
  • 206 Views

0 Members and 1 Guest are viewing this topic.

*

Offline Dave Partner

  • Administrator
  • Full Member
  • *****
  • 116
    • View Profile
Javascript tutorial - 2 - Concatenation
« on: November 06, 2016, 05:37:47 AM »

<!DOCTYPE html>
<html>
<head>
   
</head>


<body>
   <script type="text/javascript">
      /*
      More operators : comparison operators
         ==   equal to
         ===   equal value and equal type (data types)
         !=   not equal
         !==   not equal value or not equal type
         >   greater than
         <   less than
         >=   greater than or equal to
         <=   less than or equal to
         ?   ternary operator
      */
      
      /*
      //greater than
      var number1 = 4;
      var number2 = 12;
      
      if(number2 > number1){
         document.write("Yes its greater");
      }
      
      
      //less than
      var number1 = 4;
      var number2 = 12;
      
      if(number2 < number1){
         document.write("Yes its greater");
      }
      
      
      //greater than or equal to
      var number1 = 4;
      var number2 = 12;
      
      if(number2 >= number1){
         document.write("Yes its greater or equal");
      }
      
      //less than or equal to
      var number1 = 4;
      var number2 = 12;
      
      if(number2 <= number1){
         document.write("Yes its greater or equal");
      }
      */
      
      //tenary
      var number1 = 4;
      var number2 = 12;
      
      (number1 == number2)? document.write("yes"): document.write("no");
      


   </script>
</body>
</html>