A more apt name would be “selector operators.”
Hear me out.
If you’ve written software with PHP or any statically typed language, you’d know that the value of any expression including either
&& will return a boolean.
The name logical operators doesn’t completely describe the function of
&& will return one (and only one) of the two expression values rather than a boolean value.
Quoting the ES5 spec from section 11.11
The value produced by a
||operator is not necessarily of type Boolean. The value produced will always be the value of one the two operand expressions.
Consider the following:
var a = 10; var b = "foo" var c = null; a || b // 10 a && b // "foo" c || b // "foo" c && b // null
Static code analysis is a method of debugging by examining source code before a program is run. It's done by analyzing a set of code against a set (or multiple sets) of coding rules. Static code analysis and static analysis are often used interchangeably, along with source code analysis.