Skip to content

Commit 6d7a0e1

Browse files
authored
Use Number.isNaN() instead of val == NaN
Comparison to NaN is useless. Nothing is equal to NaN, not even NaN. Use Number.isNaN().
1 parent dbf3e7e commit 6d7a0e1

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

dist/core/generic.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,7 @@ class NDframe {
238238

239239
if (this.series) {
240240
this.values.map(val => {
241-
if (val == NaN) {
242-
new_arr.push(true);
243-
} else if (isNaN(val) && typeof val != "string") {
241+
if (isNaN(val) && typeof val != "string") {
244242
new_arr.push(true);
245243
} else {
246244
new_arr.push(false);
@@ -251,9 +249,7 @@ class NDframe {
251249
row_data.map(arr => {
252250
let temp_arr = [];
253251
arr.map(val => {
254-
if (val == NaN) {
255-
temp_arr.push(true);
256-
} else if (isNaN(val) && typeof val != "string") {
252+
if (isNaN(val) && typeof val != "string") {
257253
temp_arr.push(true);
258254
} else {
259255
temp_arr.push(false);
@@ -396,4 +392,4 @@ class NDframe {
396392

397393
}
398394

399-
exports.default = NDframe;
395+
exports.default = NDframe;

0 commit comments

Comments
 (0)