FED58. 返回函数
描述
实现函数 functionFunction,调用之后满足如下条件:示例1
输入:
functionFunction('Hello')('world')
输出:
Hello, world
HTML/CSS/JavaScript 解法, 执行用时: 858ms, 内存消耗: 77760KB, 提交时间: 2021-05-31
{"css":"","js":"function functionFunction(str) {\n let f = function(s) {\n return str + ', ' + s\n }\n return f\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 859ms, 内存消耗: 77820KB, 提交时间: 2021-07-04
{"css":"","js":"function functionFunction(str) {\n return f = function(arr) {\n return str + ', ' + arr\n }\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 861ms, 内存消耗: 77772KB, 提交时间: 2021-03-17
{"css":"","js":"function functionFunction(str) {\n let resFunc = (nextStr) => {\n return str + \", \" + nextStr\n }\n return resFunc;\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 861ms, 内存消耗: 77836KB, 提交时间: 2021-03-04
{"css":"","js":"function functionFunction(str) {\n var f = function (x) {\n return str + ', ' + x;\n }\n return f;\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 861ms, 内存消耗: 77840KB, 提交时间: 2021-04-02
{"css":"","js":"function functionFunction(str) {\n return function(item) {\n return str + ', ' + item;\n }\n};\nfunctionFunction(functionFunction('Hello')('world'))","html":"","libs":[]}