Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>JavaScript Snippets for VS CodeNew to Visual Studio Code? Get it now.
JavaScript Snippets for VS Code

JavaScript Snippets for VS Code

Chris Noring

|
2,913 installs
| (0) | Free
Snippets for JavaScript
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

js-snippets

This is an extension meant to give you some awesome JS snippets alt text

Features

A collection of JS snippets

The following commands are available:

  • js-log, prints console.log()
  • js-log-err, prints console.error()
  • js-log-warn, prints console.warn(),
  • js-log-info, prints console.info()
  • js-elif, prints if, else
  • js-eliff, prints if, else-if, else
  • js-tcf, prints try, catch, finally
  • js-scd, prints switch, case, default
  • js-arr-filter, creates an array and calls filter()
  • js-arr-reduce, creates an array and calls reduce()
  • js-arr-contains, creates an array and calls some()
  • js-arr-all, creates an array and calls every(),
  • js-dest-array, creates an array and applies destructuring on it
  • js-dest-object, creates an object and applies destrucring on it
  • js-dest-param, creates a function and passes a parameter that we apply destructuring to
  • js-promise-create, creates a Promise by instantiating it
  • js-promise-shorthand, uses the static resolve/reject, good for unit tests
  • js-promise-all, uses the static all(), allows us to have a list of Promises finish at the same time
  • js-async-await, demonstrates async/await
  • js-regex-test-digits, demonstrates string method test() that takes a regular expression and return true/false if string is number.
  • js-regex-test-word, demonstrates string method test() that takes a regular expression and returns true/false if string is word.
  • js-regex-match, demonstrates RegEx match, that.
  • js-regex-match-named-group, demonstrates RegEx match and use a so called named group.
  • js-rest, shows the ES6 features REST.
  • js-rest-function, shows the REST feature when used in a function.
  • js-property-shorthand, shows how you can type less when declaring properties in an object.
  • js-computed-props, shows computed properties in an object.

Release Notes

This is the release notes.

1.0.0

Added video to showcase usage

0.0.6

added promises and async/await

0.0.6

Changed array commands so you find the under js-arr-*.

Added destructuring snippets, read more on it here [Destructuring(https://developer.mozillaorg/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)

0.0.5

adding repo and image, renaming all commands to js- something to make it easier to find them

0.0.4

minor corrections

0.0.3

  • added try, catch, finally
  • added switch, case, default
  • added array methods filter(), reduce(), some() and all

0.0.2

added if, else, better docs

0.0.1

some log functions for now

Publisher

Chris Noring @chris_noring

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft