Last active
April 7, 2018 19:38
-
-
Save cyhalothrin/b46838042cc180da5235d95dc502fb66 to your computer and use it in GitHub Desktop.
VS code snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"require module": { | |
"prefix": "reqm", | |
"body": [ | |
"const $1 = require('$1');" | |
] | |
}, | |
"for array": { | |
"prefix": "fora", | |
"body": [ | |
"for (let ${i} = 0; ${i} < ${array}.length; ${i}++) {", | |
" const element = ${array}[${i}];", | |
"}" | |
] | |
}, | |
"for i": { | |
"prefix": "forx", | |
"body": [ | |
"for (let ${i} = 0; ${i} < ${max}; ${i}++) {", | |
" ", | |
"}" | |
] | |
}, | |
"console.log()": { | |
"prefix": "clg", | |
"body": "console.log($1);" | |
}, | |
"if .. else": { | |
"prefix": "ife", | |
"body": [ | |
"if ($1) {", | |
" ", | |
"} else {", | |
" ", | |
"}" | |
] | |
}, | |
"else if": { | |
"prefix": "elif", | |
"body": [ | |
"else if ($1) {", | |
" ", | |
"}" | |
] | |
}, | |
"for .. in": { | |
"prefix": "forin", | |
"body": [ | |
"for (const ${key} in ${object}) {", | |
" if (${object}.hasOwnProperty(${key})) {", | |
" const ${value} = ${object}[${key}];", | |
" }", | |
"}" | |
] | |
}, | |
"Arrow function": { | |
"prefix": "arfn", | |
"body": [ | |
"($1) => {", | |
" $2", | |
"}" | |
] | |
}, | |
"Promise.all()": { | |
"prefix": "promall", | |
"body": [ | |
"Promise.all([", | |
" $1", | |
"]);" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment