Skip to content

Instantly share code, notes, and snippets.

@Cool-Runningz
Last active September 23, 2021 16:51
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cool-Runningz/53192bbc74bebd4183db49f2c8ecdbde to your computer and use it in GitHub Desktop.
Save Cool-Runningz/53192bbc74bebd4183db49f2c8ecdbde to your computer and use it in GitHub Desktop.
VSCode Snippets - JavaScript
{
"Console Log": {
"prefix": "cl",
"body": "console.log('$1')",
"description": "Inserts console.log('')"
},
"Inserts a noop": {
"prefix": "noop",
"body": ["() => {}"],
"description": "Inserts a noop"
},
"Inserts console.groupCollapsed('<label>')": {
"prefix": "cgc",
"body": [
"console.groupCollapsed(\"$1\")",
"console.log(\"$2\")",
"console.groupEnd()"
],
"description": "Inserts console.groupCollapsed('<label>')"
},
"Inserts console.table(data, [columns])": {
"prefix": "ct",
"body": ["console.table()"],
"description": "Inserts console.table(data, [columns])"
},
"Arrow Function": {
"prefix": "arrow",
"body": ["const ${1:functionName} = ($2) => {", " $3", "}"],
"description": "Arrow Function"
},
"Array Methods": {
"prefix": "arrm",
"body": [
"${1|map,filter,indexOf,findIndex,forEach,reduce,some,find|}((${2:item}) => {",
" $3",
"})"
],
"description": "Array Methods"
},
"useEffect": {
"prefix": "ueh",
"body": ["useEffect(() => {", "", "},[]);"],
"description": "Inserts useEffect hook stub"
},
"useState": {
"prefix": "ush",
"body": "const [$1, set$2] = useState($3)",
"description": "Inserts useState hook stub"
},
"iife": {
"prefix": "iife",
"body": ["((${1:arguments}) => {", "${0}", "})(${2});"],
"description": "Inserts iife stub"
},
"useRef": {
"prefix": "urh",
"body": ["const $1Ref = useRef($2)"],
"description": "Inserts useRef hook stub"
},
"Inserts console.dir()": {
"prefix": "cd",
"body": ["console.dir($1)"],
"description": "Inserts console.dir()"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment