Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript 递归 #10

Open
Geek-James opened this issue Jul 18, 2019 · 0 comments
Open

JavaScript 递归 #10

Geek-James opened this issue Jul 18, 2019 · 0 comments
Labels
JavaScript About JavaScript

Comments

@Geek-James
Copy link
Owner

参考资料:

递归的案例

  • 斐波那契数列 第三个数等于前两个数的和
function f(n) {
        if (n === 1 || n === 2) {
            return 1;
        }
        return f(n - 1) + f(n - 2);
    }

@Geek-James Geek-James changed the title Javascript 递归 JavaScript 递归 Jul 18, 2019
@Geek-James Geek-James added the JavaScript About JavaScript label Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript About JavaScript
Projects
None yet
Development

No branches or pull requests

1 participant