ResourcesJavascriptGuides
Guide to declarations in Javascript
Introduction
This guide covers various ways of declaration in Javascript, from basic variable declarations to more advanced topics like declaring classes and modules. We included Typescript declarations too.
Also, take in mind declaration
is not the same thing as assignment
.
Declarations
Variable declarations
var
declaration
let
,const
declaration
There is the difference about scope and what you can do with variables declared with var
, let
, const
.
If you want to get in-depth knowledge about the differences here is the article: Difference between var, let and const
Array Declaration
Function Declaration
Default function declaration:
Arrow function declaration:
I personally love arrow functions and use them all the time!