디스트럭쳐링1 ES6 주요 문법 활용하기 export & import //file: fibonacci.js //since these variables are not exported //they are private to the module. Code //in other modules can't reference them let fib1 = 0; let fib2 = 1; /** * next() returns the next number in the Fibonacci sequence. * @returns {number} */ export function next() { let current = fib1; fib1 = fib2; fib2 = current + fib1; return current; } /** * reset() resets the Fi.. 2020. 10. 1. 이전 1 다음