JavaScript Snippets for Visual Studio Code
Collection of JavaScript snippets for your productivity.
Declarations
.add -> .add($1);
.add -> .addEventListener($1, );
.app -> .appendChild($1);
.app -> .apply($1)
.ass -> .assign($1, )
.bin -> .bind($1)
.cal -> .call($1)
.cat -> .catch($);
.cla -> .classList
.clo -> .cloneNode($1);
.con -> .concat($1)
.con -> .contains($1)
.con -> .contains($1)
.cop -> .copyWithin($1)
.cre -> .create($1)
.cre -> .createElement($1);
.def -> .defineProperties($1, )
.def -> .defineProperty($1, )
.dis -> .dispatchEvent($1);
.ent -> .entries($1)
.ent -> .entries($1)
.eve -> .every($1)
.fil -> .fill($1)
.fil -> .filter($1)
.fin -> .find($1)
.fin -> .findIndex($1 => $1)
.for -> .forEach($1)
.fre -> .freeze($1)
.fro -> .from($1)
.fro -> .fromEntries($1)
.get -> .getAttribute($1)
.get -> .getElementById($1)
.get -> .getElementsByClassName($1)
.get -> .getElementsByTagName($1)
.has -> .hasAttribute($1)
.inc -> .includes($1)
.ind -> .indexOf($1)
.inn -> .innerHTML
.ins -> .insertBefore($1);
.is -> .is($1, )
.isa -> .isArray($1)
.ise -> .isExtensible($1)
.isf -> .isFrozen($1)
.iss -> .isSealed($1)
.joi -> .join($1)
.key -> .keys($1)
.key -> .keys($1)
.las -> .lastIndexOf($1)
.map -> .map($1)
.out -> .outerHTML
.par -> .parentElement
.par -> .parentNode
.pop -> .pop()
.pre -> .preventExtensions($1)
.pro -> .prototype
.pus -> .push($1)
.que -> .querySelector($1)
.que -> .querySelectorAll($1)
.red -> .reduce($1)
.red -> .reduceRight($1)
.rem -> .remove($1);
.rem -> .removeAttribute($1);
.rem -> .removeChild($1);
.rem -> .removeEventListener($1, );
.rep -> .replace($1, );
.rep -> .replaceChild($1, );
.rev -> .reverse()
.sea -> .seal($1)
.set -> .setAttribute($1, );
.shi -> .shift()
.sli -> .slice()
.som -> .some($1)
.sor -> .sort($1)
.sorf -> (a, b) => { if ($1) { return -1; } if () { return 1; } return 0; }
.sorm -> (a, b) => a - b
.spl -> .splice($1)
.tex -> .textContent
.the -> .then($1 => $1)
.tof -> .toFixed($1)
.tog -> .toggle($1);
.tol -> .toLocaleString($1)
.tos -> .toString($1)
.uns -> .unshift($1)
.val -> .values($1)
.val -> .values($1)
ale -> alert($1);
arr -> Array
arr -> Array.from($1)
arr -> Array.isArray($1)
arr -> Array.of($1)
blu -> blur
cd -> console.dir($1);
ce -> console.error($1);
cha -> change
ci -> console.info($1);
cl -> console.log($1);
cla -> class $1 { constructor(props) {} }
cle -> clearInterval($1);
cle -> clearTimeout($1);
cli -> click
con -> confirm($1);
cw -> console.warn($1);
deb -> debugger;
def -> default
do -> do { $1 } while ();
doc -> document
exp -> export
fnar -> ($1) => { }
fnaraf -> ($1, i, arr) => { }
fnarm -> $1 => $1
foc -> focus
foc -> focusout
for -> const $1Len = $1.length; for (let i = 0; i < $1Len; i += 1) { const $1Item = $1[i]; }
foraw -> for await (let item of $1) { }
forin -> for (const key in $1) { }
form -> for (let j = 0; j < $1Len; j += 1) { const $1Item = $1[j]; }
forof -> for (const item of $1) { }
forr -> for (let r = $1Len - 1; r >= 0; r -= 1) { const $1Item = $1[r]; }
fun -> function $1() { }
fun -> function() { $1 }
iife -> (function() { $1 })();
imp -> import
impm -> import from $1;
imps -> import { } from $1;
inp -> input
json -> JSON.parse($1);
json -> JSON.stringify($1);
key -> keydown
map -> new Map($1)
mou -> mouseout
mou -> mouseover
obj -> Object
obj -> Object.assign($1, )
obj -> Object.create($1, )
obj -> Object.defineProperties($1, )
obj -> Object.defineProperty($1, )
obj -> Object.entries($1)
obj -> Object.freeze($1)
obj -> Object.fromEntries($1)
obj -> Object.is($1, )
obj -> Object.isExtensible($1)
obj -> Object.isFrozen($1)
obj -> Object.isSealed($1)
obj -> Object.keys($1)
obj -> Object.preventExtensions($1)
obj -> Object.seal($1)
obj -> Object.values($1)
of -> .of($1)
par -> parseFloat($1)
par -> parseInt($1)
pro -> Promise.all($1)
pro -> new Promise((resolve, reject) => { resolve($1); })
pro -> prompt($1);
set -> new Set($1)
set -> setInterval($1, 700);
set -> setTimeout($1, 700);
swi -> switch ($1) { case : break; default: break; }
whi -> while ($1) { }