Difference between '=', '==' and '===' operators?



Difference between '=', '==' and '===' operators?..

Answer / Purushottam Yadav

'=' is the assignment operator. It assigns a value to a variable, returning the assigned value (e.g., var x = 5 returns 5). '==' compares two values for equality, considering type coercion (e.g., '5' == 5 returns true). '===' also compares for equality but does not perform type coercion, only comparing identical values and data types (e.g., '5' === 5 returns false).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

Should you use var or let?

1 Answers  


Why do we use javascript?

1 Answers  


Why do we need currying?

1 Answers  


Is JavaScript a case-sensitive language?

1 Answers  


show the date in textbox when we select item (items like-- today,yesterday,lastweek,lastmonth,lastyear) from dropdownlist using javascript?

1 Answers  


How are object properties assigned?

1 Answers  


Explain why asynchronous code is important in javascript?

1 Answers  


Explain equality operators in javascript?

1 Answers  


To put a "close window" link on a page ?

1 Answers  


You have an asp. Net web application running on a web-farm that does not use sticky sessions - so the requests for a session are not guaranteed to be served the same machine. Occasionally, the users get error message validation of view state mac failed. What could be one reason that is causing this error?

1 Answers  


What does it mean in javascript?

1 Answers  


What are the seven data types of javascript?

1 Answers  


Categories