1/*--------------------------------------------------------------------------------------------- 2 * Copyright (c) Microsoft Corporation and GitHub. All rights reserved. 3 *--------------------------------------------------------------------------------------------*/ 4 5// Write a functon that computes the nth Fibonacci number 6// By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two. 7export function fib(n) { 8 if (n < 2) { 9 return n 10 } 11 return fib(n - 1) + fib(n - 2) 12} 13