mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
Use ESM syntax and remove console.log()
This commit is contained in:
@ -33,6 +33,4 @@ const factorialDigitSum = (n = 100) => {
|
|||||||
return digits.reduce((prev, current) => prev + current, 0)
|
return digits.reduce((prev, current) => prev + current, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Factorial digit sum of 100! :', factorialDigitSum())
|
export { factorialDigitSum }
|
||||||
|
|
||||||
module.exports = factorialDigitSum
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const factorialDigitSum = require('../Problem020')
|
import { factorialDigitSum } from '../Problem020'
|
||||||
|
|
||||||
describe('Check Problem 20 - Factorial digit sum', () => {
|
describe('Check Problem 20 - Factorial digit sum', () => {
|
||||||
it('Factorial digit sum of 10!', () => {
|
it('Factorial digit sum of 10!', () => {
|
||||||
|
Reference in New Issue
Block a user