![]() Output is: ValueOne and ValueTwo are the same See the code below : var valueOne = 3 Ĭonsole.log("ValueOne and ValueTwo are the same") Ĭonsole.log("ValueOne and ValueTwo are NOT the same") Ĭan you guess the output? You may or may not be surprised, but these values are considered to be the same. On the other hand, the identity operator ( =) requires both data types to be the same, as a prerequisite. Remember when performing comparisons, the equality operator ( =) will attempt to make the data types the same before proceeding. The correct decision is based on knowledge that how actually they work? Let’s understand. Many developers do not understand the correct version they use in specific scenarios. If you have worked on javascript then you must have noticed these two operators to compare values. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |