mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 10:19:02 +00:00
Updated For-In Loops in snippets
This commit is contained in:
@@ -150,12 +150,13 @@
|
||||
},
|
||||
"For-In Loop": {
|
||||
"prefix": "forin",
|
||||
"body": [
|
||||
"body": [
|
||||
"for (const ${1:key} in ${2:object}) {",
|
||||
"\tif (Object.prototype.hasOwnProperty.call(${2:object}, ${1:key})) {",
|
||||
"\t\tconst ${3:element} = ${2:object}[${1:key}];",
|
||||
"\t\t$TM_SELECTED_TEXT$0",
|
||||
"\t}",
|
||||
"\tif (!${2:object}.hasOwn(${1:key})) continue;",
|
||||
"\t",
|
||||
"\tconst ${3:element} = ${2:object}[${1:key}];",
|
||||
"\t",
|
||||
"\t$TM_SELECTED_TEXT$0",
|
||||
"}"
|
||||
],
|
||||
"description": "For-In Loop"
|
||||
|
||||
Reference in New Issue
Block a user