Language Flashcards
Increase your technical jargon and learn the exact words to describe your code.
What is Code?
Code is the text that makes up programs.
What is an Expression?
A fragment of code that produces a value. Every value that is written literally is an expression.
What is a Statement?
If an expression corresponds to a sentence fragment, a JavaScript statement corresponds to a full sentence. A program is a list of statements.
If an expression corresponds to a sentence fragment, a JavaScript statement corresponds to a full sentence. A program is a list of statements.
What is a Binding?
To catch and hold values, JavaScript provides a thing called a binding, or variables.
What is the Environment?
The collection of bindings and their values that exist at a given time is called the environment.
What is a Function?
A function is a piece of program wrapped in a value. Such values can be applied in order to run the wrapped program.
What is a Program?
A program is a collection of statements, which contain expressions that are executed from top to bottom.
What is scope?
The part of the program where the binding is visible.
What is lexical scoping
The set of bindings visible inside a block is determined by the place of that block in the program text. Each local scope can also see all the local scopes that contain it, and all scopes can see the global scope. This approach to binding visibility is called lexical scoping.
What is Closure?
A feature of a function that allows there to be a reference to a specific instance of a local binding in an enclosing scope.
What is an example of Closure?
function multiplier(factor) { return number => number * factor; } let twice = multiplier(2); console.log(twice(5)); // → 10
What is Recursion?
A function that calls itself.
What is an example of a recursive function?
function findSolution(target) { function find(current, history) { if (current == target) { return history; } else if (current > target) { return null; } else { return find(current + 5, `(${history} + 5)`) || find(current * 3, `(${history} * 3)`); } } return find(1, "1");
What is control flow?
Enables us to decide which lines are run based on our code base.
What is coercion?
A way in which we can implicitly or explicitly change the value of datatypes.
What does lexically scoped mean?
The location at which a variable is declared determines its scope.
What is a ReferenceError?
An error where the program could not find any reference to the variable; possible the variable doesn’t exist.
What is a compiler?
A compiler is a program that converts your Java program into code called bytecode.
- checks program for syntax errors
- generates a new program that is readable by the language.
What does the diagram for the Java Runtime Environment look like?
- Source code: ‘human readable code’ = file extension.”java”;
- Compiler
- Bytecode: ‘JVM readable code’ = file extension.”class”
- Windows, Mac, Linux
What is OOP?
Object-oriented programming is an approach to programming that uses the concept of classes and objects.
What are three kinds of scopes?
Global Scope, Function Scope, and Block Scope (created by ‘let’)
What is projection?
Applying a function to a value and creating a new value is called a projection. To project one array into another, we apply a projection function to each item in the array and collect the results in a new array.
What is React?
React is a JavaScript library used for building user interfaces.
What is Redux in terms of React?
A way to manage state within React.
What is z-index?
The z-index property specifies the stack order of an element. An element with greater stack order is always in front of an element with a lower stack order.
What does URL stand for?
Uniform Resource Locator
What is a closure?
A function contained within a function where the inner function has access to the scope of the enclosing outer function.
What is hoisting?
When a function and variable declarations are added to memory during the compile phase.
Hoisting is usually defined as “declarations being moved to top of your code” because that’s what seems to be happening but the code doesn’t actually physically move to the top of the file.
What are side effects?
A side effect is any application state change that is observable outside the called function other than its return value.
What is a syntax parser?
A program that reads your code and determines if its function and the validity of its grammar.
What is lexical environment?
Where something sits physically in the code you write.
What is execution context?
A wrapper to help manage the code that is running.
What is single-threaded synchronous execution?
One at a time and in order, JavaScript runs its code this way.
What is variable environment?
Where the variables live in memory and how they relate to each other.
What is Asynchronous?
More than one at a time.
What is Event Queue?
Javascript runs this once the call stack is empty. It’s a stack of events that are placed in order from the browser.
What is a Primitive Type?
A type of data that represents a single value; that is not an object.
What are the 6 Primitive types?
- Undefined
- Null
- Boolean
- Number
- String
- Symbol