Merge pull request #178 from guileen/my-js-snippets

improve for loop of javascript
This commit is contained in:
Honza Pokorny 2013-03-06 02:09:50 -08:00
commit 9acb78b2e9

View File

@ -52,13 +52,13 @@ snippet case
${3} ${3}
# for (...) {...} # for (...) {...}
snippet for snippet for
for (var ${2:i} = 0; $2 < ${1:Things}.length; $2${3: += 1}) { for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2 ++) {
${4:$1[$2]} var ${3:v} = $1[$2];${4:}
} }
# for (...) {...} (Improved Native For-Loop) # for (...) {...} (Improved Native For-Loop)
snippet forr snippet forr
for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2${3: -= 1}) { for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2 --) {
${4:$1[$2]} var ${3:v} = $1[$2];${4:}
} }
# while (...) {...} # while (...) {...}
snippet wh snippet wh