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:
parent
32518b7e76
commit
80c490153a
1 changed files with 1 additions and 1 deletions
|
@ -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*.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue