feat(Polynomial.js): Fixed bad code

This commit is contained in:
Rak Laptudirm
2021-05-21 11:38:25 +05:30
parent f1769c4df6
commit b702faadc5

View File

@ -32,11 +32,9 @@ class Polynomial {
return `(${coefficient}x^${exponent})` return `(${coefficient}x^${exponent})`
} }
}) })
.filter((x) => { .filter((x) =>
if (x !== '0') { x !== '0'
return x )
}
})
.reverse() .reverse()
.join(' + ') .join(' + ')
} }