Merge pull request #123 from lencioni/improve-js-for-snippet
Javascript: Improve JavaScript `for` snippets
This commit is contained in:
commit
b5777773ea
@ -32,15 +32,15 @@ ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {
|
|||||||
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet for "for (...) {...} (faster)"
|
snippet for "for (...) {...} (counting up)" b
|
||||||
for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2--) {
|
for (var ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) {
|
||||||
${3:$1[$2]}${VISUAL}$0
|
${VISUAL}$0
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet for "for (...) {...}"
|
snippet ford "for (...) {...} (counting down, faster)" b
|
||||||
for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) {
|
for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) {
|
||||||
${3:$1[$2]}${VISUAL}$0
|
${VISUAL}$0
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user