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})`
}
})
.filter((x) => {
if (x !== '0') {
return x
}
})
.filter((x) =>
x !== '0'
)
.reverse()
.join(' + ')
}