mirror of
https://github.com/bellard/quickjs.git
synced 2025-11-15 18:22:15 +03:00
2020-01-05 release
This commit is contained in:
10
examples/fib_module.js
Normal file
10
examples/fib_module.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/* fib module */
|
||||
export function fib(n)
|
||||
{
|
||||
if (n <= 0)
|
||||
return 0;
|
||||
else if (n == 1)
|
||||
return 1;
|
||||
else
|
||||
return fib(n - 1) + fib(n - 2);
|
||||
}
|
||||
Reference in New Issue
Block a user