Learning a New Language Flashcards
runtime environment
is a set of technologies that determine how to execute the code
Declaring (in JavaScript)
stating a variable’s name with details about it’s scoping and mutability
Assigning (in JavaScript)
creating a reference between a variable and an object
let variable (in JavaScript)
A variable that is block-scoped and re-assignable.
const variable (in JavaScript)
A constant variable. THis variable is block-scoped and read-only. Constants are the type of variable we’ll use most often.
Declaration and Assignment (in JavaScript
In JavaScript, there are two distinct steps when dealing with variables:
declaration
assignment
Declaration is the step of stating a variable’s name, and what kind of variable it is. Different kinds of variables have different scope and re-assignment properties. We only need to declare a variable once. We never need to re-declare it.
Assignment is the step of giving a value to the variable, using the assignment operator =. Re-assignment also uses the assignment operator.
let
let is one of three kinds of declared variables. let is A block-scoped variable.
const
const is one of three kinds of declared variables. const is a block-scoped variable that is read-only. Ressignment raises a TypeError.
var
DONT USE var. var is one of three kinds of declared variables. var is a variable without block scobing. If defined within a function, it will have scope throughout the entire function. If defined outside a function it will have global scope. DONT USE. BAD