mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
feat(Polynomial.js): Fixed bad code
This commit is contained in:
@ -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(' + ')
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user