UNPKG

mcalc

Version:

math calculator

26 lines 493 B
var call_counter= require('./call_counter'); function mult(x,y){ call_counter(); return x*y; } function div(x,y){ call_counter(); return x/y; } function fibo(count,counter, first, second){ if(count==0) return 0; if(count== undefined){ counter=1; first=1; second=2; } result= first+second; if(count== counter) return result; fibo(count, counter++, second, result); retun result; } module.exports = { multiplication:mult, divide:div, fibonnaci:fibo }