Commits


P42 authored and Brian Hulette committed 7c944e8e066
ARROW-12798: [JS] Use == null Comparison The `== null` check is a concise expression to identify nullish values (`null` and `undefined`). This refactoring replaces the following combinations of longer strict equality checks with the shorter `null` comparison: * `a === null || a === undefined` becomes `a == null` * `b !== null && b !== undefined` becomes `b != null` * `x.f(1, 2) === null || x.f(1, 2) === undefined` becomes `x.f(1, 2) == null` Learn More: [Equality comparisons and sameness (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness), [Equality table](https://dorey.github.io/JavaScript-Equality-Table/) When two similar-looking function calls have a side effect, this refactoring can change the behavior of the code. For example, the refactoring changes: ```javascript let a = f(1) === null || f(1) === undefined; ``` into ```javascript let a = f(1) == null; ``` If `f(1)` has a side effect, it would have been called once or twice before the refactoring, and once after the refactoring. This means that the side effect would have been called a different number of times, potentially changing the behavior. Closes #10338 from domoritz/p42/eq_eq_null/1621098523557 Authored-by: P42 <72252241+p42-ai[bot]@users.noreply.github.com> Signed-off-by: Brian Hulette <hulettbh@gmail.com>