From 4f92635fd01e224448cd2bb687e32ea8cc4d04bd Mon Sep 17 00:00:00 2001 From: Benjamin Collignon Date: Fri, 9 Sep 2022 10:46:11 +0200 Subject: [PATCH 1/2] Add snippet DeclareVariable Adding a javascript snippet for simple variable declaration. --- snippets/snippets.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 74dee93..b11c622 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -221,5 +221,10 @@ "prefix": "cte", "body": "console.timeEnd(${1:object});", "description": "Sets end point for execution time measurement" - } + }, + "DeclareVariable":{ + "prefix": "var", + "body": "var ${1:variable} = ${2:value};", + "description": "Declare a variable." + } } From e77a347f12d4a2f409d230e3feac3344c17efb08 Mon Sep 17 00:00:00 2001 From: Benjamin Collignon Date: Fri, 9 Sep 2022 11:15:58 +0200 Subject: [PATCH 2/2] Add DeclareVariable readme Adding variable declaration to readme. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 499e2ca..fceeac5 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ Below is a list of all available snippets and the triggers of each one. The ** | `sto→` | set timeout helper method `setTimeout(() => {});` | | `prom→` | creates a new Promise `return new Promise((resolve, reject) => {});`| | `thenc→` | adds then and catch declaration to a promise `.then((res) => {}).catch((err) => {});`| +| `var→` | creates a new variable `var variable = value;` | ### Console methods | Trigger | Content |