invalid left-hand side in assignment

JavaScript
// invalid left-hand side in assignment
// here "=" is used as the assign the operator to assign John to name
var name = "John"

// here "=" is used for comparison, but it should be "==" or "==="
if(name = "John" || name = "David"){
	
}
Source

Also in JavaScript: