题解 | #判断斐波那契数组#
判断斐波那契数组
https://www.nowcoder.com/practice/9df2a366eb25495caff41612bd0ffca6
<!DOCTYPE html> <html> <head> <meta charset=utf-8> </head> <body> <script type="text/javascript"> const _isFibonacci = array => { // 补全代码 if (array.length >= 3) { for(i = 2; i < array.length; i++ ) { if (array[i] === array[i - 1] + array[i - 2]) { return true } else { return false } } } else { return false } } </script> </body> </html>