Is there a way in javascript
(or typescript) to prevent redundant object rewriting within an if
statement condition?
For example:
if (A != null || A != B) {
// do something here
}
// can it be done like this:
if (A != null || != B) { // avoid repeating "A" here
// do something here
}
Does anyone have suggestions or any other questions related to this topic?