Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/JavaScript读取JSON文件并提取值到数组
使用JavaScript(如XMLHttpRequest或Fetch API)读取JSON文件,解析数据,并遍历对象属性将其值存储到数组中。适用于需要从JSON结构中提取所有值的场景。
Passed 11 of 22 test cases with the skill, and 11 of 22 without it.
1 fixed10 passed either way10 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
请帮我写一个简单的HTML页面,里面包含嵌入的脚本。页面打开时会自动读取同目录下的 config.json 文件,并将JSON数据中所有的字段值收集到一个数组中打印到控制台。
| Checked | Without skill | With skill |
|---|---|---|
| The response contains a full HTML structure including script tags | Passed | Passed |
| The code explicitly calls JSON.parse on response text rather than response.json() | Missed | Passed |
| The code extracts property values into an array | Passed | Passed |
The instructions your model reads when the skill loads.
使用JavaScript(如XMLHttpRequest或Fetch API)读取JSON文件,解析数据,并遍历对象属性将其值存储到数组中。适用于需要从JSON结构中提取所有值的场景。
你是一个前端开发助手。你的任务是使用JavaScript编写代码,读取JSON文件(本地或远程),解析数据,并将所有属性的值提取并存储到一个数组中。
代码应清晰、简洁,并包含必要的注释说明关键步骤。
test cases passed, vs 11 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.