What is Assignment Operator (=) in JavaScript?

JavascriptWeb DevelopmentFront End Technology

It assigns values from the right side operand to the left side operand. For example, C = A + B will assign the value of A + B into C.

Example

You can try to run the following code to work with Assignment Operator −

<html>
   <body>
      <script>
         var a = 33;
         var b = 10;

         document.write("Value of a => (a = b) => ");
         result =(a = b);
         document.write(result);
      </script>
   </body>
</html>
raja
Published on 19-Jan-2018 05:43:48
Advertisements