列表

详情


FED50. 避免全局变量

描述

给定的 js 代码中存在全局变量,请修复

原站题解

HTML/CSS/JavaScript 解法, 执行用时: 840ms, 内存消耗: 77772KB, 提交时间: 2020-12-28

{"css":"","js":"function globals() {\n  var  myObject = {\n      name : 'Jory'\n    };\n\n    return myObject;\n}","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 841ms, 内存消耗: 77772KB, 提交时间: 2020-12-28

{"css":"","js":"function globals() {\n    let myObject = {\n      name : 'Jory'\n    };\n\n    return myObject;\n}","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 842ms, 内存消耗: 77772KB, 提交时间: 2020-12-28

{"css":"","js":"function globals() {\n    let myObject = {\n      name : 'Jory'\n    };\n\n    return myObject;\n}","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 842ms, 内存消耗: 77772KB, 提交时间: 2020-12-27

{"css":"","js":"function globals() {\n   var myObject = {\n      name : 'Jory'\n    };\n\n    return myObject;\n}","html":"","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 842ms, 内存消耗: 77812KB, 提交时间: 2020-11-23

{"css":"","js":"function globals() {\n   let myObject = {\n      name : 'Jory'\n    };\n\n    return myObject;\n}","html":"","libs":[]}

上一题