我是 Visual Studio 代码的新手。我正在寻找有用的 vs code 插件,我发现Turbo Console Log是一个不错的插件。
\n现在安装后,在 settings.json 中,我做了一些更改,
\n "turboConsoleLog.wrapLogMessage":true,\n "turboConsoleLog.insertEnclosingFunction":true,\n "turboConsoleLog.includeFileNameAndLineNum":true,\nRun Code Online (Sandbox Code Playgroud)\n我还注意到 Turbo 控制台日志在那里并且ctrl+alt+L与其他日志没有任何冲突。\n
现在,当我尝试通过选择单词然后按 来使用时ctrl+alt+L,
变量替换为 \xcc\xa5
有人遇到类似的问题吗?
\n编辑:
\n\n我有两个这样的变量,一个是对象数组,一个是对象对象
let state_checklist = [
{
id: '1',
title: 'Q1',
question_id: 'CuaQV',
},
{
id: '2',
title: 'Q3',
question_id: 'XKVbQ',
},
{
id: '3',
title: 'Q2',
question_id: 'zmId1',
},
];
let state_question = {
2: { answer: 'yes', comments: '', question_id: 'CuaQV' },
3: { answer: 'no', comments: '', question_id: 'zmId1' },
};
Run Code Online (Sandbox Code Playgroud)
现在我想创建一个像这样的结构
{
"zmId1": {
"answer": "yes",
"comments": "",
"question_id": "zmId1",
"title": "Q2"
},
"CuaQV": {
"answer": "no",
"comments": "",
"question_id": "CuaQV",
"title": "Q1"
}
}
Run Code Online (Sandbox Code Playgroud)
其中 key …