JS: Variable
Variable do not need to be declared.
You can simply assign it e.g. x = 3
.
It becomes property of global object.
But in modern JavaScript since 2020, variable are always declared,
using
let
or
const
.
Variable do not need to be declared.
You can simply assign it e.g. x = 3
.
It becomes property of global object.
But in modern JavaScript since 2020, variable are always declared,
using
let
or
const
.