Updated For-In Loops in snippets

This commit is contained in:
Da-nie-elT
2025-08-21 13:42:27 +02:00
parent 4da00f39ab
commit 215dbb213a
2 changed files with 11 additions and 9 deletions

View File

@@ -98,10 +98,11 @@
"prefix": "forin",
"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"