What is the difference between == and = operators?

“==” is used as a comparison operator. You are asking whether two values are the same, and results in a boolean (either true or false) value.

“=” is an assignment operator. You use it to assign a value to the variable (name = ‘John’)

Advertisements