Skip to content

Instantly share code, notes, and snippets.

@tlareg
Last active December 6, 2016 10:34
Show Gist options
  • Save tlareg/4f5785aa47b4228a961abd46935f689c to your computer and use it in GitHub Desktop.
Save tlareg/4f5785aa47b4228a961abd46935f689c to your computer and use it in GitHub Desktop.
VSC js snippets
{
"console log": {
"prefix": "cl",
"body": [
"console.log($1)"
],
"description": ""
},
"lambda": {
"prefix": "lb",
"body": [
"(${1:args}) => {${2:body}}"
],
"description": ""
},
"function": {
"prefix": "fn",
"body": [
"function ${1:name}(${2:args}) {",
" ${3:body}",
"}"
],
"description": ""
},
"if": {
"prefix": "i",
"body": [
"if (${1:condition}) {",
" ${2:body}",
"}"
],
"description": ""
},
"reduce": {
"prefix": "red",
"body": [
"${1:arr}.reduce((${2:acc}, ${3:item}) => {",
" ${5:body}",
" return ${2:acc}",
"}, ${4:initial})"
],
"description": ""
},
"lodash reduce": {
"prefix": "_red",
"body": [
"_.reduce(${1:arr}, (${2:acc}, ${3:item}) => {",
" ${5:body}",
" return ${2:acc}",
"}, ${4:initial})"
],
"description": ""
},
"map": {
"prefix": "map",
"body": [
"${1:arr}.map((${2:item}) => {",
" return ${2:item}",
"})"
],
"description": ""
},
"lodash map": {
"prefix": "_map",
"body": [
"_.map(${1:arr}, ${2:item} => {",
" return ${2:item}",
"})"
],
"description": ""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment