all operators must return a value

All operators should return a value because of the definition of the term 'operator'. 
I could not find an operator as an exception which doesn't return a value.
Do you?
This commit is contained in:
Mustafa Kemal Tuna 2021-01-07 12:09:31 +03:00 committed by GitHub
parent 32518b7e76
commit 80c490153a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,7 +219,7 @@ alert( x ); // 5
The fact of `=` being an operator, not a "magical" language construct has an interesting implication.
Most operators in JavaScript return a value. That's obvious for `+` and `-`, but also true for `=`.
All operators in JavaScript return a value. That's obvious for `+` and `-`, but also true for `=`.
The call `x = value` writes the `value` into `x` *and then returns it*.