Skip to content

Commit 64be4e7

Browse files
xuhdevlewars
authored andcommitted
Update js-mode "for" to keep up with modern JS syntax (AndreaCrotti#514)
"let" contains the scope of the variable to the loop, while "var" always declares global scope. Following up AndreaCrotti#305
1 parent 543e439 commit 64be4e7

File tree

1 file changed

+1
-1
lines changed
  • snippets/js-mode

1 file changed

+1
-1
lines changed

snippets/js-mode/for

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- mode: snippet; require-final-newline: nil -*-
22
# name: for
33
# --
4-
for (var ${1:i} = ${2:0}; $1 < ${3:collection}.length; $1++) {
4+
for (let ${1:i} = ${2:0}; $1 < ${3:collection}.length; $1++) {
55
$0
66
}

0 commit comments

Comments
 (0)