JavaScript Snippets installs statistics
By Nathan Chapman · VS Code Marketplace · Snippets
Visual Studio Code snippets for JavaScript, TypeScript, and React
JavaScript Snippets has 172,142 recorded installs on VS Code Marketplace, an increase of 0.2% over the past 30 days, ranking #1704 of 2,515 tracked listings.
Rating: 4.75 / 5 from 4 ratings
About JavaScript Snippets
✂️ vscode-javascript-snippets
Visual Studio Code snippets for JavaScript, TypeScript, and React
Code snippets are templates that make it easier to autocomplete repeating code patterns. They're like shortcuts for writing code.
Setup
Just install this package from the Extension Marketplace, then add "editor.snippetSuggestions": "top" to your user settings to see these snippets on top in the suggestion popover. Make sure you've also set "editor.tabCompletion": "on" for tab completion.
Snippets
These snippets are optimized to be short and easy to remember.
They follow JavaScript Standard Style.
They also support tab autocompletion to accelerate your workflow!
Below is a list of all available snippets and the shortcuts for each one. The ⇥ means the tab key.
JavaScript
Declarations
v⇥ var statement
var ${0}
v=⇥ var assignment
var ${1:name} = ${2:value}
l⇥ let statement
let ${0}
l=⇥ let assignment
let ${1:name} = ${2:value}
dl=⇥ destructuring let assignment
let {${1:name}} = ${2:value}
co⇥ const statement
const ${0}
co=⇥ const assignment
const ${1:name} = ${2:value}
dco=⇥ destructuring const assignment
const {${1:name}} = ${2:value}
Flow Control
if⇥ if statement
if (${1:condition}) {
${0}
}
el⇥ else statement
else {
${0}
}
ife⇥ if/else statement
if (${1:condition}) {
${0}
} else {
}
ei⇥ else if statement
else if (${1:condition}) {
${0}
}
ter⇥ ternary operator
${1:condition} ? ${2:expression} : ${3:expression}
fl⇥ for loop
for (let ${1:i} = 0, ${2:len} = ${3:iterable}.length; ${1:i} < ${2:len}; ${1:i}++) {
${0}
}
rfl⇥ reverse for loop
for (let ${1:i} = ${2:iterable}.length - 1; ${1:i} >= 0; ${1:i}--) {
${0}
}
fi⇥ for in loop
for (let ${1:key} in ${2:array}) {
if (${2:array}.hasOwnProperty(${1:key})) {
${0}
}
}
},
fo⇥ for of loop (ES6)
for (let ${1:key} of ${2:array}) {
${0}
}
wl⇥ while loop
while (${1:condition}) {
${0}
}
tc⇥ try/catch
try {
${0}
} catch (${1:err}) {
}
tf⇥ try/finally
try {
${0}
} finally {
}
tcf⇥ try/catch/finally
try {
${0}
} catch (${1:err}) {
} finally {
}
sw⇥ switch case
switch (${1:expr}) {
case ${2:value}:
return $0
default:
return
}
Functions
f⇥ anonymous function
function (${1:arguments}) {
${0}
}
fn⇥ named function
function ${1:name}(${2:arguments}) {
${0}
}
iife⇥ immediately-invoked function expression (IIFE)
((${1:arguments}) => {
${0}
})(${2})
fa⇥ function apply
${1:fn}.apply(${2:this}, ${3:arguments})
fc⇥ function call
${1:fn}.call(${2:this}, ${3:arguments})
fb⇥ function bind
${1:fn}.bind(${2:this}, ${3:arguments})
af⇥ arrow function (ES6)
(${1:arguments}) => ${2:statement}
afb⇥ arrow function with body (ES6)
(${1:arguments}) => {
${0}
}
gf⇥ generator function (ES6)
function* (${1:arguments}) {
${0}
}
gfn⇥ named generator function (ES6)
function* ${1:name}(${2:arguments}) {
${0}
}
Iterables
seq⇥ sequence of 0..n
[...Array(${1:length}).keys()]${0}
fe⇥ forEach loop
${1}.forEach((${2:item}) => {
${0}
})
map⇥ map
${1}.map((${2:item}) => {
${0}
})
reduce⇥ reduce
${1}.reduce((${2:previous}, ${3:current}) => {
${0}
}${4:, initial})
filter⇥ filter
${1}.filter(${2:item} => {
${0}
})
find⇥ find
${1}.find(${2:item} => {
${0}
})
Objects and Classes
ol⇥ object literal
{
kv${0}
}
slol⇥ same-line object literal
{ kv${0} }
kv⇥ key/value pair
${1:key}: ${2:value},
c⇥ class (ES6)
class ${1:name} {
constructor(${2:arguments}) {
${0}
}
}
cex⇥ child class (ES6)
class ${1:name} extends ${2:base} {
constructor(${3:arguments}) {
super(${3:arguments})
${0}
}
}
ctor⇥ class constructor (ES6)
constructor(${1:arguments}) {
super(${1:arguments})
${0}
}
m⇥ method (ES6 syntax)
${1:method}(${2:arguments}) {
${0}
}
get⇥ getter (ES6 syntax)
get ${1:property}() {
${0}
}
set⇥ setter (ES6 syntax)
set ${1:property}(${2:value}) {
${0}
}
```…
Description from the VS Code Marketplace listing.
- javascript
- snippet
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Ratings over time
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Installs on a linear scale. Placement is projected from installs, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (50)Similar VS Code Marketplace Snippets plugins
All 20 JavaScript Snippets alternativesData source
Install counts, average rating, and rating counts come from the public Visual Studio Marketplace gallery API. Installs are cumulative and exclude updates.
Listing: https://marketplace.visualstudio.com/items?itemName=nathanchapman.JavaScriptSnippets. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.