选择题2题:输出什么?

1const add = () => { 2 const cache = {}; 3 return num => { 4 if (num in cache) { 5 return `From cache! ${cache[num]}`; 6 } else { 7 const result = num + 10; 8 cache[num] = result; 9 return `Calculated! ${result}`; 10 } 11 }; 12}; 13 14const addFunction = add(); 15console.log(addFunction(10)); 16console.log(addFunction(10)); 17console.log(addFunction(5 * 2));
难度:
更新时间:2022-10-30

本题为单选题”

赞赏支持

预览

题库维护不易,您的支持就是我们最大的动力!