- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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