Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
what is the main difference between '=' and '==' operators in javascript?
The use of "=" operator is that it assigns value from right to left, whereas "==" shows whether the given values are equal or not.In the following example variables x and y were assigned values using "=" operator and their magnitudes were checked using "==" operator.
Example
<html>
<body>
<p id="equal"></p>
<script>
var x = 5;
var y = "6";
document.write(x);
document.getElementById("equal").innerHTML =
(x == y);
</script>
</body>
</html>
Output
false 5
Advertisements
