Day 1: Functions

/*
 * Create the function factorial here
 */
function factorial(n) {
    return (n >= 1 && n <= 10) ? n * factorial(n - 1) : 1;
}

 

posted @ 2019-07-20 11:27  乱世有歌舞  阅读(130)  评论(0编辑  收藏  举报