FED31. 对象属性键名
描述
请补全JavaScript函数,要求以数组的形式输出对象各个属性的键名。HTML/CSS/JavaScript 解法, 执行用时: 1678ms, 内存消耗: 77796KB, 提交时间: 2022-02-09
{"css":"","js":"function _keys(object) {\n // 补全代码\n let arr=[];\n for(let i in object){\n arr.push(i)\n }\n return arr\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1692ms, 内存消耗: 77812KB, 提交时间: 2022-02-09
{"css":"","js":"function _keys(object) {\n // 补全代码\n var arr = [];\n for(var key in object){\n arr.push(key);\n }\n return arr;\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1736ms, 内存消耗: 77884KB, 提交时间: 2021-12-15
{"css":"","js":"function _keys(object) {\n return Object.keys(object)\n }","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1739ms, 内存消耗: 77840KB, 提交时间: 2021-12-17
{"css":"","js":"function _keys(object) {\n // 补全代码\n return Object.keys(object) \n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1740ms, 内存消耗: 77772KB, 提交时间: 2021-12-14
{"css":"","js":"function _keys(object) {\n // 补全代码\n let arr=[];\n for(let i in object){\n arr.push(i);\n }\n return arr;\n}","html":"","libs":[]}