math_example_test_ar
Version:
an example of creatingpackage, Created by Glenn Johnson I used this package to practice. It is from Programming in HTML5 with Java Script and CSS3 book, any use of this package and any related code is subject to original auther Glenn Johnson aproval
36 lines (30 loc) • 673 B
JavaScript
var call_counter=require('./call_counter');
function multyply(x,y) {
call_counter();
return x*y;
}
function divide(x,y) {
call_counter();
return x/y;
}
function filbo(count) {
call_counter();
return private_fibo(count);
}
function private_fibo(count, counter, first, second){
if(count==0) return 0;
if(couner==undefined){
counter=1;
first=1;
second=1;
}
result=first+second;
if(counter==count) return result;
private_fibo(cout,++counter,second,result)
return result;
}
module.exports={
multiplication:multyply,
division:divide,
fibonaci:filbo
}