== means only compare the value. if you have to used only == equal and they don’t checked the any datatype. if the datatype mismatch then also it will return true.=== means compare value with the datatype also if both are same then it will return true otherwise it will return false.
== compares the value=== compares value and type
I have very good explaied artificial on =, ==, === in Java script. https://www.c-sharpcorner.com/article/difference-between-and-in-javascript2/
This is very common interview question in javascript most of the interviewer asked this kind of question the very basic example is
1 == ‘1’ The result of this answer is true because when we compare two values using double equal then it comapares only value but 1 === ‘1’ this gives us false because this time not only checkes the value but its data type also.
== compares the value === compares value and type
In JavaScript it means Same value and type. For Example, 5 == "5" // It will return true because it evaluate the same value 5 === "5" // It will return false because it evaluate both same value as well as same type.Hope this will resolve your query.
== Just compares the value. Whereas, === compares the value as well as its datatype. If the data type and value both matches then only it will be true, else will return false.
This is a very standard question for javascript. The answer is as below:
= is used for assigning values to a variable in JavaScript.== is used for comparison between two variables irrespective of the datatype of variable.=== is used for comparision between two variables but this will check strict type, which means it will check datatype and compare two values.
My Article to understand with example.https://www.c-sharpcorner.com/article/difference-between-and-in-javascript2/
== this will compare value onlyand === will compare value as well as type
both are same functions except === compares the value and datatype so when validate 3==="3" return false because value same but data type string
Follow this video which explain clearly,
https://www.youtube.com/watch?v=S7p9QStPUGo