Merge pull request #364 from pgilad/patch-1

Add useful javascript snippets
This commit is contained in:
Honza Pokorny 2014-05-08 03:05:58 -03:00
commit 8ee0f3a440

View File

@ -79,6 +79,14 @@ setTimeout(function() {
}${2:.bind(${3:this})}, ${1:10}); }${2:.bind(${3:this})}, ${1:10});
endsnippet endsnippet
snippet fi "for prop in obj using hasOwnProperty" b
for (${1:prop} in ${2:obj}){
if ($2.hasOwnProperty($1)) {
${VISUAL}$0
}
}
endsnippet
# Snippets for Console Debug Output # Snippets for Console Debug Output
snippet ca "console.assert" b snippet ca "console.assert" b
@ -121,6 +129,10 @@ snippet cl "console.log" b
console.log(${1:"${2:value}"}); console.log(${1:"${2:value}"});
endsnippet endsnippet
snippet cd "console.debug" b
console.debug(${1:"${2:value}"});
endsnippet
snippet cprof "console.profile" b snippet cprof "console.profile" b
console.profile("${1:label}"); console.profile("${1:label}");
${VISUAL}$0 ${VISUAL}$0