{
"define module": {
"prefix": "define",
"body": [
"define([",
"\t'require',",
"\t'${1:dependency}'",
"], function(require, ${2:factory}) {",
"\t'use strict';",
"\t$0",
"});"
],
"description": "define module"
},
"For Loop": {
"prefix": "for",
"for (let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tconst ${3:element} = ${2:array}[${1:index}];",
"}"
"description": "For Loop"
"For-Each Loop": {
"prefix": "foreach",
"${1:array}.forEach(${2:element} => {",
"description": "For-Each Loop"
"For-In Loop": {
"prefix": "forin",
"for (const ${1:key} in ${2:object}) {",
"\tif (Object.hasOwnProperty.call(${2:object}, ${1:key})) {",
"\t\tconst ${3:element} = ${2:object}[${1:key}];",
"\t\t$0",
"\t}",
"description": "For-In Loop"
"For-Of Loop": {
"prefix": "forof",
"for (const ${1:iterator} of ${2:object}) {",
"description": "For-Of Loop"
"Function Statement": {
"prefix": "function",
"function ${1:name}(${2:params}) {",
"description": "Function Statement"
"If Statement": {
"prefix": "if",
"if (${1:condition}) {",
"description": "If Statement"
"If-Else Statement": {
"prefix": "ifelse",
"} else {",
"\t",
"description": "If-Else Statement"
"New Statement": {
"prefix": "new",
"const ${1:name} = new ${2:type}(${3:arguments});$0"
"description": "New Statement"
"Switch Statement": {
"prefix": "switch",
"switch (${1:key}) {",
"\tcase ${2:value}:",
"\t\tbreak;",
"",
"\tdefault:",
"description": "Switch Statement"
"While Statement": {
"prefix": "while",
"while (${1:condition}) {",
"description": "While Statement"
"Do-While Statement": {
"prefix": "dowhile",
"do {",
"} while (${1:condition});"
"description": "Do-While Statement"
"Try-Catch Statement": {
"prefix": "trycatch",
"try {",
"} catch (${1:error}) {",
"description": "Try-Catch Statement"
"Set Timeout Function": {
"prefix": "settimeout",
"setTimeout(() => {",
"}, ${1:timeout});"
"description": "Set Timeout Function"
"Set Interval Function": {
"prefix": "setinterval",
"setInterval(() => {",
"}, ${1:interval});"
"description": "Set Interval Function"
"Import external module.": {
"prefix": "import statement",
"import { $0 } from \"${1:module}\";"
"description": "Import external module."
"Region Start": {
"prefix": "#region",
"//#region $0"
"description": "Folding Region Start"
"Region End": {
"prefix": "#endregion",
"//#endregion"
"description": "Folding Region End"
"Log to the console": {
"prefix": "log",
"console.log($1);"
"description": "Log to the console"
"Log warning to console": {
"prefix": "warn",
"console.warn($1);"
"description": "Log warning to the console"
"Log error to console": {
"prefix": "error",
"console.error($1);"
"description": "Log error to the console"
}