mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 08:16:50 +08:00
feat(Polynomial.js): Fixed bad code
This commit is contained in:
@ -32,11 +32,9 @@ class Polynomial {
|
||||
return `(${coefficient}x^${exponent})`
|
||||
}
|
||||
})
|
||||
.filter((x) => {
|
||||
if (x !== '0') {
|
||||
return x
|
||||
}
|
||||
})
|
||||
.filter((x) =>
|
||||
x !== '0'
|
||||
)
|
||||
.reverse()
|
||||
.join(' + ')
|
||||
}
|
||||
|
Reference in New Issue
Block a user