JavaScript Fundamentals Flashcards
Mod 2
Data Type
A type of data, e.g., String, Boolean, Number, Object, Array, etc.
Primitives / Simple Data Types
Basic data types like String, Boolean, Number
Complex Data Types
Data types that are not Primitives, e.g., Objects, Arrays
Object
A data structure of key value pairs that groups related data and behavior
Key
The name used to refer to a Value in an Object
Value
The value referenced by a Key in an Object
Array
List-like objects, used for storing a list of related values.
Function
A grouping of executable code. Objects that contain JS code which can be repeatedly invoked/executed. Can be manipulated just like any other Object.
Method
A function that’s defined as a property of an object
Scope / Context
Where variables and functions are accessible
Parameters
The variables a function says it will take in when it runs. Declared inside (parens)
Arguments
The actual variables a function uses when it runs
Prototype
An object that allows a one object to inherit methods and properties from another
Primitive (Primitive value, Primitive data type)
Data that is not an object and has no methods. There are 7 primitive data types: string, number, bigint, boolean, null, undefined, and symbol. All primitives are immutable, i.e., they cannot be altered.
JavaScript Engine/Interpreter
A program that executes JavaScript code. Most commonly used in web browsers.
Hoisting
The process of implicitly moving the declaration of variables and functions to the top of their scope
Creation Phase
The phase where the interpreter sets aside some space in memory to store any variables and functions we might need access to.
Execution Phase
The phase where the interpreter executes Javascript code, line-by-line
Execution Call Stack
A tool (data structure) for the interpreter to keep track of its place in a script that calls multiple functions
TDD
Test Driven Development / Design
Assertion
An expression containing some testable logic
Assertion Library
A package of assertion functionality. Usually distinct from a Testing Framework.
Testing Framework
A library that determines how tests are organized and executed
Red Green Refactor
The process of writing a failing test, making it pass, then refactoring the tests and/or implementation with confidence
Test Phases
A test that is organized into the phases [Setup, Execution, Assertion, Teardown*]
Object-oriented programming (OOP)
An approach that structures your code around objects rather than functions and procedures, real-world objects are each viewed as separate entities having their own state which is modified only by built-in procedures, called methods
Programming paradigm
A style or way of thinking about and approaching programming problems
Constructor Function
The function called to create a new instance of an object. Usually contains the code to set up the object.
Class
A blueprint or template of an object that describes what information it should contain and how it should interact with the data
Instance
One specific copy of an object
Encapsulation
Hiding the details of how an object works by grouping data and behavior
SRP Single Responsibility Principle
a class should only have one responsibility, ‘one reason to change’