Notes JavaScript Flashcards
What must all methods have?
a period
method name
parentheses
Define methods
They return information about an object and are called by appending an instance.
Define Built in objects
Contain methods that can be called by appending the object name with a period, method name and parentheses.
Define Template Literals
They are strings that allow embedded expressions ${expression}
They use back ticks instead of quotation marks. key below esc button
What does an iteration statement do?
Updates the iterator each time the loop is created
What does a stopping condition do?
Determines when to stop looping. It will run until the expression evaluates to false.
What does initialization do?
Defines where to begin the loop by declaring (or referencing) the iterator variable.
Define how objects execute “when passed as arguments”.
They are passed by reference and are therefore mutable.
The object itself is not a copy
The object is accessible and mutable inside the function.
Define Javascript object literal value key pairs.
*Key-value pairs of an object can be referred to as properties.
*They are enclosed in curly brackets {}
*Values are mapped to keys in the object with a colon symbol :
*Key value pairs are separated by commas ,
*All keys are unique, VALUES are not.
What does method Math.floor (); do?
Returns the largest number integer less than or equal to the given number.
What does Math.random (); do?
Returns a number between 0 and 1
Define numbers.
Primitive data type
include the set of all integers and floating point numbers.
Define block scope variables.
The variables ‘const’ and ‘let’ are only accessible in their block or nested block.
Define code block scope.
Only visible within a code block – in-between curly brackets.
{…}
Define function scope.
Only visible within the function
Define file or module scope.
The value/function can only be accessed from within the file.
Define Global scope.
A value/function in global scope can be used anywhere in the entire program.