Skip to content

Commit

Permalink
Merge pull request #145 from TheAlgorithms/factorial.js-Standardjs-fixes
Browse files Browse the repository at this point in the history
factorial.js: Standardjs fixes
  • Loading branch information
cclauss committed May 4, 2020
2 parents d53c112 + 4d856f8 commit ab22a0e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions maths/factorial.js
Expand Up @@ -13,7 +13,7 @@

'use strict'

function calc_range (num) {
function calcRange (num) {
// Generate a range of numbers from 1 to `num`.
var i = 1
var range = []
Expand All @@ -24,9 +24,9 @@ function calc_range (num) {
return range
}

function calc_factorial (num) {
function calcFactorial (num) {
var factorial
var range = calc_range(num)
var range = calcRange(num)

// Check if the number is negative, positive, null, undefined, or zero
if (num < 0) {
Expand All @@ -48,5 +48,6 @@ function calc_factorial (num) {
}

// Run `factorial` Function to find average of a list of numbers.
/* global alert, prompt */
var num = prompt('Enter a number: ')
alert(calc_factorial(num))
console.log(calcFactorial(num))

0 comments on commit ab22a0e

Please sign in to comment.