Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.