diff --git a/fibonacci_series/Javascript/fibonacci.js b/fibonacci_series/Javascript/fibonacci.js index f7a714b..4b1a128 100644 --- a/fibonacci_series/Javascript/fibonacci.js +++ b/fibonacci_series/Javascript/fibonacci.js @@ -1,19 +1,21 @@ +// program to generate fibonacci series up to a certain number -/*codacy does not allow console logging , but there is no other alternative for this since I am not running it on any browser. -If at all this needs to be passed as 0 issues on codacy , I will need to remove all the console.log() and then there will be simply no -output although the function will run all fine.*/ +// take input from the user +const number = parseInt(prompt("Enter a positive number: ")); +let n1 = 0, n2 = 1, nextTerm; -function fibonacci(n){ - let n1 = 0 , n2 =1 ,next ; - next = n1+n2; - console.log("fibonacci series :"); - console.log(n1); - console.log(n2); - while (next