还需要考虑溢出等问题,闲来无事写了写
Funca = (arg1, arg2) => 0f;//initvar depth = 8;a = (lastNumber, currentNumber) => { if (depth <= 0) return currentNumber; depth--; return a(currentNumber, currentNumber + lastNumber); };var result = a(0, 1);
本文共 266 字,大约阅读时间需要 1 分钟。
还需要考虑溢出等问题,闲来无事写了写
Funca = (arg1, arg2) => 0f;//initvar depth = 8;a = (lastNumber, currentNumber) => { if (depth <= 0) return currentNumber; depth--; return a(currentNumber, currentNumber + lastNumber); };var result = a(0, 1);
转载地址:http://mivkx.baihongyu.com/