Aug 9, 2024
var
, let
, and const
.var
, let
, const
.
var
is function-scoped, can be redeclared and reassigned.let
is block-scoped, can be reassigned but not redeclared.const
is block-scoped, cannot be reassigned or redeclared.console.log
method to print messages.demo.js
) to HTML (index.html
).node <filename.js>
to execute JavaScript files.var
, let
, and const
.var
: Redeclaration and reassignment allowed.let
: Reassignment allowed, redeclaration not allowed.const
: Neither reassignment nor redeclaration allowed.[ ]
) with values separated by commas.array[index]
).push()
: Adds element to end.pop()
: Removes element from end.unshift()
: Adds element to start.shift()
: Removes element from start.{}
) with key-value pairs.object.key
).object['key']
).delete
keyword.function
keyword.functionName()
).