提交 d2f1fd47 编写于 作者: M Matt Bierner

Update a few more vars to const in js/ts snippets

Fixes #35322
上级 ebffb73e
......@@ -25,7 +25,7 @@
"For-Each Loop": {
"prefix": "foreach",
"body": [
"${1:array}.forEach((${2:element}) => {",
"${1:array}.forEach(${2:element} => {",
"\t$0",
"});"
],
......@@ -34,7 +34,7 @@
"For-In Loop": {
"prefix": "forin",
"body": [
"for (let ${1:key} in ${2:object}) {",
"for (const ${1:key} in ${2:object}) {",
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tconst ${3:element} = ${2:object}[${1:key}];",
"\t\t$0",
......
......@@ -25,7 +25,7 @@
"For-Each Loop": {
"prefix": "foreach",
"body": [
"${1:array}.forEach((${2:element}) => {",
"${1:array}.forEach(${2:element} => {",
"\t$0",
"});"
],
......@@ -34,7 +34,7 @@
"For-In Loop": {
"prefix": "forin",
"body": [
"for (let ${1:key} in ${2:object}) {",
"for (const ${1:key} in ${2:object}) {",
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tconst ${3:element} = ${2:object}[${1:key}];",
"\t\t$0",
......
......@@ -137,7 +137,7 @@
"prefix": "for",
"body": [
"for (let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tvar ${3:element} = ${2:array}[${1:index}];",
"\tconst ${3:element} = ${2:array}[${1:index}];",
"\t$0",
"}"
],
......@@ -155,9 +155,9 @@
"For-In Loop": {
"prefix": "forin",
"body": [
"for (var ${1:key} in ${2:object}) {",
"for (const ${1:key} in ${2:object}) {",
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
"\t\tconst ${3:element} = ${2:object}[${1:key}];",
"\t\t$0",
"\t}",
"}"
......
......@@ -137,7 +137,7 @@
"prefix": "for",
"body": [
"for (let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tvar ${3:element} = ${2:array}[${1:index}];",
"\tconst ${3:element} = ${2:array}[${1:index}];",
"\t$0",
"}"
],
......@@ -155,9 +155,9 @@
"For-In Loop": {
"prefix": "forin",
"body": [
"for (var ${1:key} in ${2:object}) {",
"for (const ${1:key} in ${2:object}) {",
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
"\t\tconst ${3:element} = ${2:object}[${1:key}];",
"\t\t$0",
"\t}",
"}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册